#include <iostream>
using namespace std;
int main() {
string num;
cin >> num;
for ( int i = 3; i >= 0; i-- ) {
cout << num[i];
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgewogICAgc3RyaW5nIG51bTsKICAgIGNpbiA+PiBudW07CiAgICBmb3IgKCBpbnQgaSA9IDM7IGkgPj0gMDsgaS0tICkgIHsKICAgICAgICBjb3V0IDw8IG51bVtpXTsKICAgIH0KICAgIHJldHVybiAwOwp9