#include <fstream>
#include <math.h>

using namespace std;

int main()
{
	ifstream input;
	ofstream output;
	long long n;
	long long count = 1;

	input.open("doitlp.inp");
	input >> n;
	input.close();

	while (n >= pow(16, count))
	{
		count++;
	}

	long long a[count];
	for (int i = 0; i < count; i++)
	{
		a[i] = n % 16;
		n /= 16;
	}
	output.open("doitlp.out");
	for (int i = count - 1; i >= 0; i--)
	{
		if (a[i] <= 9)
		{
			output << a[i];
		}
		else if (a[i] == 10) output << 'A';
		else if (a[i] == 11) output << 'B';
		else if (a[i] == 12) output << 'C';
		else if (a[i] == 13) output << 'D';
		else if (a[i] == 14) output << 'E';
		else output << 'F';
	}
	output.close();
	return 0;
}