#include <iostream>
#include <iomanip>
using namespace std;
class CA
{
public:
void run();
char intto13ch(int t);
};
char CA::intto13ch(int t)
{
if(t<10) return t+'0';
else return (t-10)+'A';
}
void CA::run()
{
int c1,c2,c3;
cin>>c1>>c2>>c3;
cout<<"#"<<intto13ch(c1/13)<<intto13ch(c1%13)<<intto13ch(c2/13)<<intto13ch(c2%13)<<intto13ch(c3/13)<<intto13ch(c3%13);
}
int main()
{
// freopen("test.in","r",stdin);
CA *a=new CA;
a->run();
return 0;
}