#include<stdio.h>
int main(){
char hexprint[] = "0123456789ABCDEF";
int z,i,input;
unsigned int mask = 0xf0000000;
scanf("%d",&input);
for ( i = 28 ; i >= 0 ; i-= 4 ) {
z = input & mask;
z >>= i;
putchar(hexprint[z]);
mask >>= 4;
}
putchar('\n');
}