import itertools boin=["i","a","a","e","u","u"] siin=["n","b","m","g","r"] N=int(raw_input()) S=[raw_input() for i in range(N)] set(S) for p in itertools.permutations(boin): for q in itertools.permutations(siin): for j in range(5): s="" for i in range(5): s+=q[i] s+=p[i] if i==j : s+= p[5] if not (s in S): print s exit() s=p[5] for i in range(5): s+=q[i] s+=p[i] if not (s in S): print s exit() print "NO"