#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;
cout<<q;
if(q>=0&&q<=9)
x=x+char(q+48);
else{
x=x+char(q+55);
}
n/=16;
}
cout<<x;
}
else{
cout<<"0";
}
return 0;
}
/**************************************************************
Problem: 1289
User: houshanglin
Language: C++
Result: Wrong Answer
****************************************************************/