#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    int a[100],k=1;
    if(n==0){
        cout<<0;
        return 0;
    }
    while(n>0){
        a[k++]=n%16;
        n=n/16;
    }
    for(int i=k-1;i>=1;i--){
        if(a[i]>=10) cout<<char('A'+a[i]-10);
        else cout<<a[i];
    }
}
/**************************************************************
	Problem: 1289
	User: wangyichen2
	Language: C++
	Result: Accepted
	Time:15 ms
	Memory:2072 kb
****************************************************************/