#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) //#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; char nameChars1[6] = {'i','a','a','e','u','u'}; char nameChars2[5] = {'n','b','m','g','r'}; char ans[11]; bool used[11]; set usedNames; bool judge() { /* bool beforeBoin = false; rep(i,11) { REP(j,0,5) { if (ans[i] == nameChars2[j]) { if (i == 10)return false; //name no saigo ga siin if (beforeBoin) return false; else beforeBoin = true; goto SKIP_I; } } beforeBoin = false; SKIP_I:; }*/ return usedNames.find(ans) == usedNames.end(); } bool f_find(int count, bool beforeSiin) { if (count == 11) { return usedNames.find(ans) == usedNames.end();//judge(); } rep(i,6) { if (!used[i]) { ans[count] = nameChars1[i]; used[i] = true; if (f_find(count+1,false)) return true; used[i] = false; ans[count] = ' '; } } if (!beforeSiin) { if (count == 10) return false; rep(i,5) { if (!used[6+i]) { ans[count] = nameChars2[i]; used[6+i] = true; if (f_find(count+1, true))return true; used[6+i] = false; ans[count] = ' '; } } } return false; } int main() { int n; char tmp[11]; cin >> n; rep(i,n) { cin >> tmp; usedNames.insert(tmp); } if (f_find(0,false)) { cout << ans << endl; } else cout << "NO" << endl; return 0; }