#include <iostream>
#include <string.h>
#include <sstream>
using namespace std;
int main(int argc, char *argv[]){
int n, aux;
stringstream hexa_aux;
cin >> n;
while(n != 0){
aux = n % 16;
n/=16;
if (aux >9){
hexa_aux << (char)(aux + 'A'-10);
}
else {
hexa_aux << (char)(aux+ '0');
}
}
string aux_str = hexa_aux.str();
cout<<string(aux_str.rbegin(), aux_str.rend());
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRlIDxzc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSl7CgogICAgaW50IG4sIGF1eDsKICAgIHN0cmluZ3N0cmVhbSBoZXhhX2F1eDsKCiAgICBjaW4gPj4gbjsKICAgIHdoaWxlKG4gIT0gMCl7CiAgICAgICAgYXV4ID0gbiAlIDE2OwogICAgICAgIG4vPTE2OwoKICAgICAgICBpZiAoYXV4ID45KXsKICAgICAgICAgICAgaGV4YV9hdXggPDwgKGNoYXIpKGF1eCArICdBJy0xMCk7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBoZXhhX2F1eCA8PCAoY2hhcikoYXV4KyAnMCcpOwogICAgICAgIH0KICAgIH0KCiAgICBzdHJpbmcgYXV4X3N0ciA9IGhleGFfYXV4LnN0cigpOwogICAgY291dDw8c3RyaW5nKGF1eF9zdHIucmJlZ2luKCksIGF1eF9zdHIucmVuZCgpKTsKCiAgICByZXR1cm4gMDsKfQ==