#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int city[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 charCity[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'
};
string input;
string output;
while ( cin >> input ) {
for ( int i = 0; i < input.length(); i++ )
input[i] -= '0';
int checkNumber = input[8];
int sum = 0;
for ( int i = 0; i < 26; i++ ) {
sum += ( ( ( city[i] % 10 ) * 9 ) + ( city[i] / 10 ) );
for ( int j = 0, k = 8; j < 8; j++, k-- )
sum += ( input[j] * k );
if ( ( sum + checkNumber) % 10 == 0 )
output += charCity[i];
sum = 0;
}
for ( int i = 0; i < output.length(); i++ )
cout << output[i];
cout << endl;
output.clear();
}
return 0;
}