#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const char A[4] = {'i', 'e', 'a', 'u'}; const char B[5] = {'n', 'b', 'm', 'g', 'r'}; map memo; string ans; void dfs(string &str, int mask, int *counter, int a_count, bool insert_flg) { if (str.size() == 11) { if (memo.count(str) == 0) { ans = str; } return; } if (ans.size() > 0) return; if (str.size() == 0 || not insert_flg) { for (int i = 0; i < 4; ++i) { if (i <= 1 && counter[i] >= 1) continue; if (i >= 2 && counter[i] >= 2) continue; str.push_back(A[i]); counter[i]++; dfs(str, mask, counter, a_count + 1, (a_count > 0 || str.size() == 1)); str.pop_back(); counter[i]--; } if (str.size() == 0 || a_count > 0) { for (int i = 0; i < 5; ++i) { if (mask >> i & 1) continue; str.push_back(B[i]); int nmask = mask | (1 << i); dfs(str, nmask, counter, 0, insert_flg); str.pop_back(); } } } else if(a_count == 0) { for (int i = 0; i < 4; ++i) { if (i <= 1 && counter[i] >= 1) continue; if (i >= 2 && counter[i] >= 2) continue; str.push_back(A[i]); counter[i]++; dfs(str, mask, counter, a_count + 1, insert_flg); str.pop_back(); counter[i]--; } } else { if (not insert_flg) { for (int i = 0; i < 4; ++i) { if (i <= 1 && counter[i] >= 1) continue; if (i >= 2 && counter[i] >= 2) continue; str.push_back(A[i]); counter[i]++; dfs(str, mask, counter, a_count + 1, true); str.pop_back(); counter[i]--; } } for (int i = 0; i < 5; ++i) { if (mask >> i & 1) continue; str.push_back(B[i]); int nmask = mask | (1 << i); dfs(str, nmask, counter, 0, insert_flg); str.pop_back(); } } } int main() { int N; cin >> N; for (int i = 0; i < N; ++i) { string s; cin >> s; memo[s] = true; } int counter[4] = {0, 0, 0, 0}; string str = ""; dfs(str, 0, counter, 0, false); if (ans.size() == 0) { cout << -1 << endl; } else { cout << ans << endl; } return 0; }