#include <iostream>
using namespace std;
char digits[] = "0123456789abcdefABCDEF";
int main() {
for (int i = 0; i < sizeof(digits)-1; ++i)
{
int d = digits[i];
cout << (d & 0xf) + ((d & 0x40) >> 3) + ((d & 0x40) >> 6) << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2hhciBkaWdpdHNbXSA9ICIwMTIzNDU2Nzg5YWJjZGVmQUJDREVGIjsKCmludCBtYWluKCkgewogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzaXplb2YoZGlnaXRzKS0xOyArK2kpCiAgICB7CiAgICAgICBpbnQgZCA9IGRpZ2l0c1tpXTsKICAgICAgIGNvdXQgPDwgKGQgJiAweGYpICsgKChkICYgMHg0MCkgPj4gMykgKyAoKGQgJiAweDQwKSA+PiA2KSA8PCBlbmRsOwogICAgfQoJcmV0dXJuIDA7Cn0=