const int N = 32 ; //Мощность алфавита
int alpha[ N] = { '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 indexof( int c) {
for ( int i = 0 ; i < N; i++ )
if ( c == alpha[ i] )
return i;
return - 1 ;
}
Y29uc3QgaW50IE4gPSAzMjsJLy/QnNC+0YnQvdC+0YHRgtGMINCw0LvRhNCw0LLQuNGC0LAKaW50IGFscGhhW05dID0geydBJywgJ0InLCAnQycsICdEJywgJ0UnLCAnRicsICdHJywgJ0gnLCAnSScsICdKJywgJ0snLAoJCQkJCSdMJywgJ00nLCAnTicsICdPJywgJ1AnLCAnUScsICdSJywgJ1MnLCAnVCcsICdVJywgJ1YnLAoJCQkJCSdXJywgJ1gnLCAnWScsICdaJywgJy4nLCAnLCcsICchJywgJz8nLCAnOicsICctJ307CmludCBpbmRleG9mKGludCBjKXsKCWZvcihpbnQgaSA9IDA7IGkgPCBOOyBpKyspCgkJaWYoYyA9PSBhbHBoYVtpXSkKCQkJcmV0dXJuIGk7CglyZXR1cm4gLTE7Cn0KCg==