using namespace std;
#include<bits/stdc++.h>
int main(){
int a;
int temp;
int len=0;//记录转换为的16进制数长度
int s[20];
while(cin>>a){
len=0;
while(a>=16){
temp=a%16;
a=(a-temp)/16;
s[len++]=temp;
}
s[len]=a;
for(int i=len;i>=0;i--){
if(s[i]<=9){
cout<<s[i];
}
else if(s[i]==10){
cout<<'A';
}
else if(s[i]==11){
cout<<'B';
}
else if(s[i]==12){
cout<<'C';
}
else if(s[i]==13){
cout<<'D';
}
else if(s[i]==14){
cout<<'E';
}
else if(s[i]==15){
cout<<'F';
}
}
cout<<'\n';
}
return 0;
}