#!/usr/bin/python from itertools import permutations, product, izip_longest who = 'inabameguru' nya = ''.join(who[i] for i in xrange(0, len(who), 2)) nyk = ''.join(who[i] for i in xrange(1, len(who), 2)) nyaa = {''.join(e) for e in permutations(nya)} nykk = {''.join(e) for e in permutations(nyk)} sett = set() for ele in product(nyaa, nykk): sett.add(''.join(map(lambda e: ''.join(e), izip_longest(*ele, fillvalue='')))) n = int(raw_input()) s = set(raw_input() for _ in xrange(n)) sett -= s print list(sett)[0] or 'NO'