#!/usr/bin/python2 from itertools import permutations, product who = 'inabameguru' m = len(who) vow = set(map(''.join, permutations(who[::2]))) con = set(map(''.join, permutations(who[1::2]))) sett = set() for p, q in product(con, vow): x = ''.join(map(''.join, zip(p, q[:-1]))) for i in xrange(m): sett.add(x[:i] + q[-1] + x[i:]) n = int(raw_input()) s = set(raw_input() for _ in xrange(n)) sett -= s res = 'NO' if sett: res = sett.pop() print(res)