<?php

$chrs = array_merge(range('a', 'z'), explode(',', '.,?,!, '));
$encode = array_fill(1, 6, array());
for ($i = 1; $i <= 6; $i++) {
    for ($j = 1; $j <= 5; $j++) {
        $encode[$i][$j] = array_shift($chrs);
    }
}

while (($line = trim(fgets(STDIN))) !== '') {
    $len = strlen($line);
    if ($len % 2 !== 0) {
        echo "NA\n";
        continue;
    }

    for ($i = 0; $i < $len; $i += 2) {
        $j = (int)$line[$i];
        $k = (int)$line[$i + 1];
        echo $encode[$j][$k];
    }
    echo PHP_EOL;
}