#include <iostream>
using namespace std;
int main() {
int num, a, b, c, d;
cin >> num;
a = num % 10;
b = num / 10 % 10;
c = num / 100 % 10;
d = num / 1000;
cout << a<< b << c << d;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbnVtLCBhLCBiLCBjLCBkOwoJY2luID4+IG51bTsKCWEgPSBudW0gJSAxMDsKCWIgPSBudW0gLyAxMCAlIDEwOwoJYyA9IG51bSAvIDEwMCAlIDEwOwoJZCA9IG51bSAvIDEwMDA7Cgljb3V0IDw8IGE8PCBiIDw8IGMgPDwgZDsKCXJldHVybiAwOwp9