#include <string>
using namespace std;
#include<algorithm>
string toHexString(int n);
//该函数可以将10进制转换为任意的radix进制数,n是要转换的十进制数
string intToA(int n,int radix)
{
    string ans="";
    do{
        int t=n%radix;
        if(t>=0&&t<=9)ans+=t+'0';
        else ans+=t-10+'A';
        n/=radix;
    }while(n);
    reverse(ans.begin(),ans.end());
    return ans;
}
int main() {

    int n;
    cin >> n;

    string hexStr = toHexString(n);
    cout << hexStr << endl;

    return 0;
}

string toHexString(int n) {
    // write your code here......
    return intToA(n,16);
}