#include <iostream>
#include <fstream>
#include <cmath>

using namespace std;

int main()
{
   long long n,a[100000],i=0;
   ifstream fi("DOITLP.INP");
   fi>>n;
   while (n>0){
   	  a[i]=n%16;
   	  n=n/16;
   	  i++;
   }
   i--;
   fi.close();
   ofstream fo("DOITLP.OUT");
   for (;i>=0;i--){
   	if (a[i]<10){fo<<a[i];
	   }
	if (a[i]==10){fo<<'A';}
	if (a[i]==11){fo<<'B';}
	if (a[i]==12){fo<<'C';}
	if (a[i]==13){fo<<'D';}
	if (a[i]==14){fo<<'E';}
	if (a[i]==15){fo<<'F';}
   }
}
