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