#include #include #include #include using namespace std; int N; vector names; char vowel[6] = {'i', 'a' ,'a', 'e', 'u', 'u'}, consonant[5] = {'n', 'b', 'm', 'g', 'r'}; bool v_used[6], c_used[5]; string answer; void DFS(int v_num, int c_num, bool prev_is_consonants, string accum) { if (answer != "") return; if (v_num == 6 && c_num == 5) { if (find(names.begin(), names.end(), accum) == names.end()) { answer = accum; } return; } for (int i = 0; i < 6; i++) { if (!v_used[i]) { v_used[i] = true; accum.push_back(vowel[i]); DFS(v_num + 1, c_num, false, accum); v_used[i] = false; accum.pop_back(); } } if (prev_is_consonants) return; for (int i = 0; i < 5; i++) { if (!c_used[i]) { c_used[i] = true; accum.push_back(consonant[i]); DFS(v_num, c_num + 1, true, accum); c_used[i] = false; accum.pop_back(); } } } void Solve() { answer = ""; DFS(0, 0, false, ""); if (answer == "") cout << "NO" << endl; else cout << answer << endl; } int main() { cin >> N; for (int i = 0; i < N; i++) { string name; cin >> name; names.push_back(name); } Solve(); return 0; }