#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; static bool usedSiin[6]; static bool usedBoin[5]; char boin[5]; char siin[6]; char tmp[11]; vector listm; bool f(int length) { if (length == 11) { bool isSinBefore = false; for (int i = 0; i < 11; i++) { if ( tmp[i] == 'n' || tmp[i] == 'b' || tmp[i] == 'm' || tmp[i] == 'g' || tmp[i] == 'r') { if (isSinBefore) { return false; } else { isSinBefore = true; } } else isSinBefore = false; } string comparer(tmp); for (int i = 0; i < listm.size(); i++) { if ( comparer.compare(listm[i]) != 0) { return false; } } return true; } //next node search for (int i = 0; i < 6; i++) // boin { if (!usedBoin[i]) { tmp[length] = boin[i]; usedBoin[i] = true; if(f(length + 1)) return true; usedBoin[i] = false; tmp[length] = NULL; return false; } } for (int i = 0; i < 5; i++) // siin { if (!usedSiin[i]) { tmp[length] = siin[i]; usedSiin[i] = true; if(f(length + 1)) return true; usedSiin[i] = false; tmp[length] = NULL; } } return false; } int main() { boin[0]='i'; boin[1]='a'; boin[2]='a'; boin[3]='e'; boin[4]='u'; boin[5]='u'; siin[0]='n'; siin[1]='b'; siin[2]='m'; siin[3]='g'; siin[4]='r'; int n ; cin >> n; string sss; rep(i,n) { cin >> sss; listm.push_back(sss); } if (f(0)) { rep(i,11) cout << tmp[i]; cout << endl; } else { cout << "No" << endl; } return 0; }