#include <iostream>
#include <fstream>
using namespace std;
int main()
{
    ifstream f1("doitlp.inp");
    long long n,j=1;
    long a[100000];
    f1>>n;
    f1.close();
    do{
        a[j]=n%16;
        n=n/16;
        j++;
    }
    while(n!=0);
    ofstream f2("doitlp.out");
    for(long i=j;i>0;i--){
        switch(a[i]){
        case 10:{f2<<"A";break;}
        case 11:{f2<<"B";break;}
        case 12:{f2<<"C";break;}
        case 13:{f2<<"D";break;}
        case 14:{f2<<"E";break;}
        case 15:{f2<<"F";break;}
        default :f2<<a[i];
        }
    }
    f2.close();
    return 0;
}
