#include
#include
char * hx16(int n,int m){
char * s=new char[100];
char *p=s;
if(n==0)*(s++)=48;
int t;
while(n){
t=n%m;
if(t>9)*s=55+t;
else *s=t+48;
n/=m;
s++;
}
*s='\0';
strrev(p);
return p;
}
int main(){
int n;
scanf("%d",&n);
printf(" 2j: %s\n",hx16(n,2));
printf(" 8j: %s\n",hx16(n,8));
printf("16j: %s\n",hx16(n,16));
return 0;
}