#include<bits/stdc++.h>
using namespace std;
int main(){
long long n;
int a[100]={0},k=0;
cin>>n;
if(n==0){
cout<<"0";
}
else{
while(n!=0){
a[k++]=n%16;
n=n/16;
}
for(int i=k-1;i>=0;i--){
if(a[i]<=10){
cout<<a[i];
}
else{
cout<<char(a[i]+55);
}
}
}
return 0;
}
/**************************************************************
Problem: 1289
User: lijinkai
Language: C++
Result: Accepted
Time:12 ms
Memory:2072 kb
****************************************************************/