#include <iostream>
#include <string.h>
#include <sstream>
using namespace std;

int main(int argc, char *argv[]){

    int n, aux;
    stringstream hexa_aux;

    cin >> n;
    while(n != 0){
        aux = n % 16;
        n/=16;

        if (aux >9){
            hexa_aux << (char)(aux + 'A'-10);
        }
        else {
            hexa_aux << (char)(aux+ '0');
        }
    }

    string aux_str = hexa_aux.str();
    cout<<string(aux_str.rbegin(), aux_str.rend());

    return 0;
}