#include <bits/stdc++.h>
using namespace std;
int main(){
int n, x;
string s;
string a = "0123456789ABCDEF";//打表
cin >> n;
while(n != 0) { //转换
x = n % 16;
s = a[x] + s;
n /= 16;
}
cout << s;
return 0;
}
n = int(input())
a = '0123456789ABCDEF' #打表
s = [""] * 100
b = 0
while n != 0:
x = n % 16
s[b] = a[x]
b += 1
n = n // 16
while b >= 0: #逆序输出
print(s[b], end = '')
b -= 1