#include <iostream>
using namespace std;

int main(){
    string msg;
    while(cin >> msg){
        if( msg.length()%2 ){
            cout << "NA" << endl;
            continue;
        }
        for(int i = 0; i < msg.length(); i+=2){
            int x = msg[i]-'0', y = msg[i+1]-'0';
            char z = (x-1)*5+(y-1)+'a';
            if( 'a' <= z && z <= 'z' ) cout << z;
            else{
                if( z-'a' == 26 ) cout << '.';
                if( z-'a' == 27 ) cout << '?';
                if( z-'a' == 28 ) cout << '!';
                if( z-'a' == 29 ) cout << ' ';
            }
        }
        cout << endl;
    }
    return 0;
}