#include <iostream>
using namespace std;

int main(void){
  string tbl = "abcdefghijklmnopqrstuvwxyz.?! ";
  string msg, dec;
  int err;
  
  while (cin >> msg){
    if (msg.size()%2){ // msg length is odd
      cout << "NA" << endl;
      continue;
    }
    err = 0;
    dec = "";
    for (int i=0; i<msg.size(); i+=2){
      int n,m;
      n = msg[i]-'1';
      m = msg[i+1] - '1';
      if (n<0 || n>=6 || m<0 || m>=5){
        err = 1;
        break;
      }
      dec += tbl[n*5+m];
    }
    if (err){
      cout << "NA" << endl;
    } else {
      cout << dec << endl;
    }
  }
  return 0;
}
