#include <iostream>
#include <fstream>
using namespace std;
int main()
{
	ifstream fi("doitlp.inp");
	ofstream fo("doitlp.out");
	long long int n;
	int a[100000],i,j;
	fi>>n;
	fi.close();
	do
	{
		a[j]=n%16;
		n=n/16;
		j++;
	}
	while (n!=0);
	for(i=j-1;i>=0;i--)
	{
		switch (a[i])
		{
			case 10: { fo<<'A'; break;}
			case 11: { fo<<'B'; break;}
			case 12: { fo<<'C'; break;}
			case 13: { fo<<'D'; break;}
			case 14: { fo<<'E'; break;}
			case 15: { fo<<'F'; break;}
			default: fo<<a[i];
		}
	}
	fo.close();
}
