#include #include #include #include using namespace std; int N; set 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_cons, string accum) { if (answer != "" || v_num < c_num - 1 + prev_is_cons) return; if (v_num == 0 && c_num == 0) { if (!prev_is_cons && names.find(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_cons) 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(6, 5, false, ""); if (answer == "") cout << "NO" << endl; else cout << answer << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> N; for (int i = 0; i < N; i++) { string name; cin >> name; names.insert(name); } Solve(); return 0; }