#include <iostream>
using namespace std;
int main() {
int bil, balik = 0, mod;
cin >> bil;
while(bil > 0) {
mod = bil%10;
balik = balik*10 + mod;
bil = bil/10;
cout << bil << endl;
cout << balik << endl << endl;
}
// Mat
// 12345 = 1234*10 + 5
// 12345/10 = 1234 + 5/10
// C++
// 12345/10 = 1234
// 12345%10 = 5
// 0
// 54321
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgYmlsLCBiYWxpayA9IDAsIG1vZDsKCWNpbiA+PiBiaWw7CgkKCXdoaWxlKGJpbCA+IDApIHsKCQltb2QgPSBiaWwlMTA7CgkJYmFsaWsgPSBiYWxpayoxMCArIG1vZDsKCQliaWwgPSBiaWwvMTA7CgkJY291dCA8PCBiaWwgPDwgZW5kbDsKCQljb3V0IDw8IGJhbGlrIDw8IGVuZGwgPDwgZW5kbDsKCX0KCQoJLy8gTWF0CgkvLyAxMjM0NSA9IDEyMzQqMTAgKyA1CgkvLyAxMjM0NS8xMCA9IDEyMzQgKyA1LzEwCgkKCS8vIEMrKwoJLy8gMTIzNDUvMTAgPSAxMjM0CgkvLyAxMjM0NSUxMCA9IDUKCQoJLy8gMAoJLy8gNTQzMjEKCQoJcmV0dXJuIDA7Cn0=