#include<stdio.h>
#include<stdlib.h>
int main(){
char en[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'};
char en_num[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 id[10];
int i,j,sum=0,sum2=0,checknum=0;
scanf("%s",id);
for(i=0,j=8;i<9;i++,j--){ //前8碼加總
sum+=(id[i]-'0') * j;
}
for(i=0;i<26;i++){
sum2=(en_num[i]) /10 + ((en_num[i]) % 10) * 9;
checknum=10 - ((sum+sum2) % 10);
if(checknum==10)
checknum=0;
if(checknum==id[8]-'0'){
printf("%c",en[i]);
checknum=0;
}
}
return 0;
}