from itertools import permutations, product N = int(input()) a = [input() for i in range(N)] vow = 'iaaeuu' con = ' nbmgr' vow_all = list(map(''.join, permutations(vow))) con_all = list(map(''.join, permutations(con))) vow_size = len(vow_all) con_size = len(con_all) all_list = [] for i in range(vow_size): for j in range(con_size): strings = '' for k in range(6): strings = strings + con_all[j][k] + vow_all[i][k] all_list.append( strings.replace(' ','') ) all_list = list(set(all_list)) for i in range(N): all_list.remove(a[i]) if len(all_list) == 0: print('NO') else: print('%s' % all_list[0])