#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    char u[6][5] = {
        '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 s;
    while(cin>>s){
        bool flag=true;
        if(s.length()%2){cout<<"NA"<<endl; flag=false;}
    if(flag){
    vector<pii>v(1000);
    rep(i,s.length()/2){
        v[i]=pii(s[2*i]-48,s[2*i+1]-48);
        if(v[i].first>6||v[i].second>5||v[i].first<=0||v[i].second<=0){cout<<"NA"<<endl;goto E;}
    }
    rep(i,s.length()/2)
    cout<<u[v[i].first-1][v[i].second-1];
    cout<<endl;
    }
    E:;
        s.clear();
    }
}