#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++;
   }
   fi.close();
   ofstream fo("DOITLP.OUT");
   for (i;i>=0;i--){
   	if (a[i]<10){fo<<a[i];
	   }
	if (a[i]>=10){fo<<char(a[i]+55);
	}
   }
}
