#!/usr/bin/python3 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 range(m): sett.add(x[:i] + q[-1] + x[i:]) n = int(input()) s = set(input() for _ in range(n)) sett -= s res = 'NO' if len(sett): res = sett.pop() print(res)