#include <iostream>
#include <fstream>
#include <cmath>
#include <string>
using namespace std;
int main()
{
    ifstream fi("doitlp.inp");
    int64_t n;
    fi>>n;
    fi.close();
    string s;
    s="";
    int64_t d;
    string a[]={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};
    ofstream fo("doitlp.out");
    while(n>0)
    {
        d=n%16;
        s=a[d]+s;
        n=n/16;
    }
    fo<<s;
    fo.close();
    return 0;
}
