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