#include <iostream>
#include <sstream>
using namespace std;
int main() {
int x;
istringstream iss("a1a56");
iss >> hex >> x;
ostringstream oss;
oss << x;
string s(oss.str());
cout << s << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCmludCB4Owppc3RyaW5nc3RyZWFtIGlzcygiYTFhNTYiKTsKaXNzID4+IGhleCA+PiB4Owpvc3RyaW5nc3RyZWFtIG9zczsKb3NzIDw8IHg7CnN0cmluZyBzKG9zcy5zdHIoKSk7Cgpjb3V0IDw8IHMgPDwgZW5kbDsKCglyZXR1cm4gMDsKfQ==