#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const int maxn=1010;
const char num[]={'0','1','2','3','4','5','6','7','8','9','A','B','C'};
int main()
{
int r,g,b;
scanf("%d %d %d",&r,&g,&b);
printf("#");
printf("%c%c%c%c%c%c\n",num[r/13],num[r%13],num[g/13],num[g%13],num[b/13],num[b%13]);
return 0;
}