#include <iostream>
using namespace std;

int main() {

	string n;	//四位数
	while (cin >> n) {
		for (int i = 3; i >=0; i--) {
			cout << n[i];
		}
		cout << endl;
	}


	system("pause");
	return 0;
}