#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
	ifstream f1;f1.open("doitlp.inp");
	long long n;
	string a[]={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};
	string s;
	s="";
	f1>>n;
	f1.close();
	int i;
	while (n!=0)
	{
		i=n%16;
		s=a[i]+s;
		n=n/16;
	}
	ofstream f2;f2.open("doitlp.out");
	f2<<s;
	f2.close();
}
	
