#include<stdio.h>
#include<string.h>
int main(void)
{
	int i,j=0;
	char N[200],Mo[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','.','?','!',' '};
	for(i=0;i<8;i++){
		scanf("%s",N);
		if(strlen(N) % 2 == 1){
			printf("NA\n");
		}
		else{
			j=0;
			while( N[j] != '\0' && N[j+1] != '\0'){
				printf("%c",Mo[N[j]-49][N[j+1]-49]);
				j += 2;
			}
			printf("\n");
		}
	}
	return 0;
}