using System; using System.Collections.Generic; using System.Linq; namespace Meguru_ha_Meguru_CS { class Program { static void Main(string[] args) { Solver sol = new Solver(); sol.Solve(); } } class Solver { int N; const int N_MAX = 129600; HashSet usedNames; // 使用済み名前 HashSet usedNamesConstants; // 使用済み子音列 HashSet constants; // 全子音列 HashSet vowels; // 全母音列 HashSet postpone; // 後回しにする子音列 string originalconstant = "nbmgr"; string originalvowel = "iaaeuu"; public void Solve() { if (N == N_MAX) { Console.WriteLine("NO"); return; } if (N == 0) { Console.WriteLine("inabameguru"); return; } // 各子音列について foreach (char[] c in Permutation.Enumurate(originalconstant)) { string sc = new string(c); // 既に使用されている子音列の場合は後回し if (usedNamesConstants.Contains(sc)) { postpone.Add(sc); continue; } // 各母音列について foreach (string sv in vowels) { // 各ローマ字読み可能な文字列について foreach (string name in RomanReadable(sc, sv)) { if (!usedNames.Contains(name)) { Console.WriteLine(name); return; } } } } // 後回しにしたもの foreach (string sc in postpone) { // 各母音列について foreach (string sv in vowels) { // 各ローマ字読み可能な文字列について foreach (string name in RomanReadable(sc, sv)) { if (!usedNames.Contains(name)) { Console.WriteLine(name); return; } } } } } public Solver() { N = ri(); usedNames = new HashSet(); usedNamesConstants = new HashSet(); constants = new HashSet(); vowels = new HashSet(); postpone = new HashSet(); for (int i = 0; i < N; i++) { string s = rs(); usedNames.Add(s); usedNamesConstants.Add(GetConstant(s)); List ca = new List(originalvowel.Length); foreach (int[] ia in Permutation.Enumurate(Enumerable.Range(0, originalvowel.Length))) { for (int j = 0; j < originalvowel.Length; j++) { ca.Add(originalvowel[ia[j]]); } vowels.Add(new string(ca.ToArray())); } } } /* 子音部分を返す */ string GetConstant(string s) { return new String(s.Where(c => c != 'a' && c != 'e' && c != 'i' && c != 'u').ToArray()); } /* ローマ字読み可能な文字列を返すイテレータ */ static IEnumerable RomanReadable(string cons, string vows) { for (int i = 0; i < 6; i++) { List res = new List(11); for (int j = 0; j < i; j++) { res.Add(cons[j]); res.Add(vows[j]); } res.Add(vows[i]); for (int j = i; j < 5; j++) { res.Add(cons[j]); res.Add(vows[j + 1]); } yield return new string(res.ToArray()); } } static String rs() { return Console.ReadLine(); } static int ri() { return int.Parse(Console.ReadLine()); } static long rl() { return long.Parse(Console.ReadLine()); } static double rd() { return double.Parse(Console.ReadLine()); } static String[] rsa() { return Console.ReadLine().Split(' '); } static int[] ria() { return Console.ReadLine().Split(' ').Select(e => int.Parse(e)).ToArray(); } static long[] rla() { return Console.ReadLine().Split(' ').Select(e => long.Parse(e)).ToArray(); } static double[] rda() { return Console.ReadLine().Split(' ').Select(e => double.Parse(e)).ToArray(); } } static class Permutation { public static IEnumerable Enumurate(IEnumerable nums) { return _GetPermutations(new List(), nums.ToList()); } static IEnumerable _GetPermutations(IEnumerable perm, IEnumerable nums) { if (nums.Count() == 0) { yield return perm.ToArray(); } else { foreach (var n in nums) { var result = _GetPermutations(perm.Concat(new T[] { n }), nums.Where(x => x.Equals(n) == false)); foreach (var xs in result) { yield return xs.ToArray(); } } } } } }