#include <algorithm>
#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <climits>
using namespace std;

long long mod = (long long)(1e9 + 7);

void decimalToHexa(long long n) {
    if (n == 0) {
        return;
    }
    decimalToHexa(n / 16);
    int digit = n % 16;
    if (digit < 10) {
        cout << digit;
    }
    else {
        if (digit == 10) {
            cout << 'A';
        }
        if (digit == 11) {
            cout << "B";
        }
        if (digit == 12) {
            cout << 'C';
        }
        if (digit == 13) {
            cout << "D";
        }
        if (digit == 14) {
            cout << 'E';
        }
        if (digit == 15) {
            cout << "F";
        }
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    long long n;cin >> n;
    if (n == 0) {
        cout << 0;
        return 0;
    }
    decimalToHexa(n);
    
}
