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])
			ret = append(ret, table[row-1][col-1])
		}
		fmt.Println(strings.Join(ret, ""))
	}
}

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)]
    else:
      return "NA"

  return mess

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

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.get(first).get(second)

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

Python: # Aizu Problem 00127: Pocket Pager Input
#
import sys, math, os, copy

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


code = {1: "afkpuz", 2: "ablqv.", 3: "chmrw?", 4: "dinsx!", 5: "ejoty "}

def pocket_pager(string):
    if len(string) % 2 == 1:
        return "NA"
    res = ""
    for k in range(len(string) // 2):
        i = int(string[2*k])
        j = int(string[2*k+1])
        res += code[j][i-1]
    return res


for line in sys.stdin:
    print(pocket_pager(line.strip()))

Python: 


def message(numbers):
    numbers=str(numbers)
    message=""
    while(len(numbers)>0):
        num=numbers[:2]
        if len(num)==1:
            return "NA"
        if int(num[0])>6 or int(num[0])<=0:
            return "NA"
        if int(num[1])>5 or int(num[1])<=0:
            return "NA"
        code=(int(num[0])-1)*5+int(num[1])
        if code>30:
            return "NA"
        if code==27:
            message+="."
        elif code==28:
            message+="?"
        elif code==29:
            message+="!"
        elif code==30:
            message+=" "
        else:
            message+=chr(code-1+ord('a'))
        numbers=numbers[2::]
    return message


while True:
    try:
        n=input()
        print(message(n))
    except EOFError:
        break

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]):

        if "1" <= first <= "6" and "1" <= second <= "5":
            message += convert.get(first).get(second)
        else:
            print("NA")
            break
    else:
        print(message)

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 EOFError:
        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: # Aizu Problem 00127: Pocket Pager Input
#
import sys, math, os, copy

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


code = {1: "afkpuz", 2: "bglqv.", 3: "chmrw?", 4: "dinsx!", 5: "ejoty "}

def pocket_pager(string):
    if len(string) % 2 == 1:
        return "NA"
    res = ""
    for k in range(len(string) // 2):
        i = int(string[2*k])
        j = int(string[2*k+1])
        if not 1 <= i <= 6 or not 1 <= j <= 5:
            return "NA"
        res += code[j][i-1]
    return res


for line in sys.stdin:
    print(pocket_pager(line.strip()))

Python: 
L = []
L.append(list("abcde"))
L.append(list("fghij"))
L.append(list("klmno"))
L.append(list("pqrst"))
L.append(list("uvwxy"))
L.append(list("z.?! "))

while True:
    try:
        tmp = input()
        l = [int(x)-1 for x in list(tmp)]
    except:
        break
    if len(l) % 2 > 0:
        print("NA")
        continue

    ferr = 0
    M = []
    for i, j in zip(l[0::2],l[1::2]):
        if i not in range(len(L)) or j not in range(len(L[0])):
            ferr += 1
        else:
            M.append(L[i][j])
    if ferr > 0:
        print("NA")
    else:
        print("".join(M))

Python: mes = {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:
        s = input()
    except:
        break
    ss = ""
    for i in range(0, len(s), 2):
        if len(s) % 2 == 1:
            ss = "NA"
            break
        if int(s[i:i+2]) in mes:
            ss+=mes[int(s[i:i+2])]
        else:
            ss = "NA"
            break
    print(ss)

Python: mes = {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:N=input()
    except:break
    if len(N) % 2 == 1:print("NA");continue
    word=""
    for i in range(0,len(N),2):
        if int(N[i:i + 2]) in mes:word +=mes[int(N[i:i + 2])]
        else:word="NA";break
    print(word)

Python: # Aizu Problem 00127: Pocket Pager Input
#
import sys, math, os, copy

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


code = {1: "afkpuz", 2: "ablqv.", 3: "chmrw?", 4: "dinsx!", 5: "ejoty "}

def pocket_pager(string):
    if len(string) % 2 == 1:
        return "NA"
    res = ""
    for k in range(len(string) // 2):
        i = int(string[2*k])
        j = int(string[2*k+1])
        if not 1 <= i <= 6 or not 1 <= j <= 5:
            return "NA"
        res += code[j][i-1]
    return res


for line in sys.stdin:
    print(pocket_pager(line.strip()))