#include<iostream>
#include<string>
using namespace std;
int main()
{
int a[26]={10,11,12,13,14,15,16,17,34,18,19,20,21,22,35,23,24,25,26,27,28,29,32,30,31,33};
char b[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
int x,m,temp,y,t1,t2;
int mip;
int sum;
string str = "";
while(cin >> x){
mip = 1;
sum = 0;
if(x%10==0)
m = 0;
else
m = 10 - x%10;
y = x/10;
while(y>0){
sum = sum + (y%10)*mip;
mip++;
y/=10;
}
for(int i=0;i<27;i++)
{
t1 = a[i]%10;
t2 = a[i]/10;
temp = t1*9 + t2*1 + sum;
if(temp%10==m)
str = str + b[i];
}
cout<<str<<'\n';
}
}
懇求大佬們幫忙