#include<bits/stdc++.h>
using namespace std;
int main(){
    long long a;
    string b;
    cin>>a;
    if(a==0){
        cout<<0;
    }else{
        while(a!=0){
            int c=a%16;
            if(c<10){
                b=char(c+'0')+b;
            }else{
                b=char(c-10+'A')+b;
            }
            a=a/16;
        }
        cout<<b;
    }
    return 0;
}
/**************************************************************
	Problem: 1289
	User: wuzhijing
	Language: C++
	Result: Accepted
	Time:12 ms
	Memory:2072 kb
****************************************************************/