#include <fstream>
#include <iostream>
using namespace std;
int main()
{
    __int64 n,a[100000];
    int d=0;
    ifstream f1("doitlp.inp");
    ofstream f2("doitlp.out");
    f1>>n;
    cin>>n;
    while (n > 0)
    {
        a[d] = n%16;
        d++;
        n /= 16;
    }
    for (int i = d-1; i > -1; i--)
    {
        if (a[i] < 10) cout<<a[i];
        if (a[i] >= 10)
        {
            if (a[i] == 10) cout<<"A";
            if (a[i] == 11) cout<<"B";
            if (a[i] == 12) cout<<"C";
            if (a[i] == 13) cout<<"D";
            if (a[i] == 14) cout<<"E";
            if (a[i] == 15) cout<<"F";
        }
    }
    for (int i = d-1; i > -1; i--)
    {
        f2<<a[i];
    }
    return 0;
}
