#include <iostream>
#include <cstdlib>
#include <climits>
using namespace std;

static int test(const char *p) {
	char *endptr;
	const long int argument = strtol (p, &endptr, 10);  // <cstdlib>
	if(endptr[0] != '\0') {
	    cerr<< p << ": arguments must be integer" << endl;
	    return -1;
	} else if (argument == LONG_MIN || argument == LONG_MAX) {  // <climits>
	    // Alternatively you can check for ERANGE in errno
	    cerr<< p << ": arguments value is out of range" << endl;
	    return -1;
	} else {
	    /* Right type of argument received */
	    cout << p << " parsed as integer" << endl;
	    return 0;
	}
}

int main() {
	char inp[128];
	while(cin >> inp) {
		test(inp);
	}
	return 0;
}