Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	table := [6][5]string{
		{"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", ".", "?", "!", " "},
	}
	for scanner.Scan() {
		input := strings.Split(scanner.Text(), "")
		if len(input)%2 != 0 {
			fmt.Println("NA")
			continue
		}
		ret := make([]string, 0)
		for i := 0; i < len(input); i += 2 {
			row, _ := strconv.Atoi(input[i])
			col, _ := strconv.Atoi(input[i+1])
			// log.Println(table[row-1][col-1])
			ret = append(ret, table[row-1][col-1])
		}
		fmt.Println(strings.Join(ret, ""))
	}
}

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0127
"""
import sys
input = sys.stdin.readline


def decode(code):
    result = ''
    while code:
        try:
            c = code[:2]
            result += Code_table[c]
            code = code[2:]
        except:
            return 'NA'
    return result


Code_table = {
    '11': 'a', '21': 'f', '31': 'k', '41': 'p', '51': 'u', '61': 'z',
    '12': 'b', '22': 'g', '32': 'l', '42': 'q', '52': 'v', '62': '.',
    '13': 'c', '23': 'h', '33': 'm', '43': 'r', '53': 'w', '63': '?',
    '14': 'd', '24': 'i', '34': 'n', '44': 's', '54': 'x', '64': '!',
    '15': 'e', '25': 'j', '35': 'o', '45': 't', '55': 'y', '65': ' ',
}
def main(args):
    for line in sys.stdin:
        result = decode(line.strip())
        print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: table = {11:'a',12:'b',13:'c',14:'d',15:'e',
         21:'f',22:'g',23:'h',24:'i',25:'j',
         31:'k',32:'l',33:'m',34:'n',35:'o',
         41:'p',42:'q',43:'r',44:'s',45:'t',
         51:'u',52:'v',53:'w',54:'x',55:'y',
         61:'z',62:'.',63:'?',64:'!',65:' '}

while True:
    try:
        mes = input()
        ans = [table.get(int(mes[i:i+2]), 'NA') for i in range(0, len(mes), 2)]
        if 'NA' in ans:
            print('NA')
        else:
            print(''.join(ans))
    except: break

Python: # AOJ 0127 Pocket Pager Input
# Python3 2018.6.18 bal4u

a = ['']*100

a[11], a[12], a[13], a[14], a[15] = 'a', 'b', 'c', 'd', 'e'
a[21], a[22], a[23], a[24], a[25] = 'f', 'g', 'h', 'i', 'j'
a[31], a[32], a[33], a[34], a[35] = 'k', 'l', 'm', 'n', 'o'
a[41], a[42], a[43], a[44], a[45] = 'p', 'q', 'r', 's', 't'
a[51], a[52], a[53], a[54], a[55] = 'u', 'v', 'w', 'x', 'y'
a[61], a[62], a[63], a[64], a[65] = 'z', '.', '?', '!', ' '

while True:
	try: buf = list(input())
	except: break
	
	f = True
	ans = ''
	for i in range(0, len(buf), 2):
		if i+1 >= len(buf):
			f = False
			break
		if buf[i].isdigit() and buf[i+1].isdigit():
			k = int(buf[i]+buf[i+1])
			if a[k] != '': ans += a[k]
			else:
				f = False
				break
	print(ans if f else "NA")

Python: def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

table = \
["afkpuz",\
 "bglqv.",\
 "chmrw?",\
 "dinsx!",\
 "ejoty "]

N = list(get_input())
for l in range(len(N)):
    str = N[l]
    ans = ""
    if len(str) % 2 == 1:
        ans = "NA"
    else:
        for i in range(0,len(str),2):
            x = str[i]
            y = str[i+1]
            if "1" <= x and x <= "6" and "1" <= y and y <= "5":
                ans = ans + table[int(y)-1][int(x)-1]
            else:
                ans = "NA"
                break

    print(ans)

Python: from sys import stdout

cs = {
    1: [None] + list("abcde"),
    2: [None] + list("fghij"),
    3: [None] + list("klmno"),
    4: [None] + list("pqrst"),
    5: [None] + list("uvwxy"),
    6: [None] + list("z.?! "),
}

while True:
    try:
        it = iter(raw_input().strip())
    except ValueError:
        break

    try:
        r = c = None
        s = []
        while True:
            r = int(it.next())
            c = int(it.next())
            s += [cs[r][c]]
            r = c = None
    except KeyError:
        stdout.write("NA\n")
    except IndexError:
        stdout.write("NA\n")
    except StopIteration:
        if not r and not c:
            stdout.write(''.join(s) + "\n")
        else:
            stdout.write("NA\n")
        continue

Python: import sys

convert = {"1": {"1": "a", "2": "b", "3": "c", "4": "d", "5": "e"},
           "2": {"1": "f", "2": "g", "3": "h", "4": "i", "5": "j"},
           "3": {"1": "k", "2": "l", "3": "m", "4": "n", "5": "o"},
           "4": {"1": "p", "2": "q", "3": "r", "4": "s", "5": "t"},
           "5": {"1": "u", "2": "v", "3": "w", "4": "x", "5": "y"},
           "6": {"1": "z", "2": ".", "3": "?", "4": "!", "5": " "},
           }

for line in sys.stdin:
    line = line[:-1]

    if len(line) % 2 != 0:
        print("NA")
        continue

    message = ""

    line = iter(line)

    for first, second in zip(*[line, line]):
        result = convert[first][second]

        if result != None:
            message += result
        else:
            print("NA")
            break
    else:
        print(message)

Python: dic = {}
base = ord("a")
for x in range(5):
  for y in range(5):
    dic[(x + 1, y + 1)] = chr(base + x * 5 + y)
dic[(6, 1)] = "z"
dic[(6, 2)] = "."
dic[(6, 3)] = "?"
dic[(6, 4)] = "!"
dic[(6, 5)] = " "

def to_mess(nums):
  if len(nums) % 2 == 1:
    return "NA"
  
  mess = ""
  for i in range(0, len(nums), 2):
    x, y = map(int, nums[i: i + 2])
    if (x, y) in dic:
      mess += dic[(x, y)]

  return mess

while True:
  try:
    nums = input()
    print(to_mess(nums))
  except EOFError:
    break

Python: from sys import stdout

cs = {
    1: [None] + list("abcde"),
    2: [None] + list("fghij"),
    3: [None] + list("klmno"),
    4: [None] + list("pqrst"),
    5: [None] + list("uvwxy"),
    6: [None] + list("z.?! "),
}

while True:
    try:
        it = iter(raw_input().strip())
    except ValueError:
        break

    try:
        r = c = None
        s = []
        while True:
            r = int(it.next())
            c = int(it.next())
            s += [cs[r][c]]
            r = c = None
    except IndexError:
        stdout.write("NA\n")
    except StopIteration:
        if not r and not c:
            stdout.write(''.join(s) + "\n")
        else:
            stdout.write("NA\n")
        continue

Python: t = [["a","f","k","p","u","z"],["b","g","l","q","v","."],["c","h","m","r","w","?"],["d","i","n","s","x","!"],["e","j","o","t","y"," "]]

while 1:
    try:
        s = input()
        ans = ""
        i = 0
        l = len(s)
        
        if l % 2 == 0:
            while i < l:
                i1 = int(s[i + 1]) - 1
                i2 = int(s[i]) - 1
                if (i1 >= 0 and i1 <= 4) and (i2 >= 0 and i2 <= 5):
                    ans += t[i1][i2]
                else:
                    break
                i += 2
        if len(ans) * 2 != l:
            ans = "NA"
        print(ans)
    except:
        break