#include<bits/stdc++.h>
using namespace std;
int main(){
long long n;
int x;
cin>>n;
string s;
char c;
while(n!=0){
x=n%16;
if(x<10)
c=x+48;
else
c=x+55;
n=n/16;
s=c+s;
}
if(s==""){
cout<<0;
}
else{
cout<<s;
}
}
/**************************************************************
Problem: 1289
User: luyanchen
Language: C++
Result: Accepted
Time:12 ms
Memory:2072 kb
****************************************************************/