#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n;
cin>>n;
int x;
char c;
string s;
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: wuyichen
Language: C++
Result: Accepted
Time:11 ms
Memory:2072 kb
****************************************************************/