/* -*- coding: utf-8 -*- * * 233.cc: No.233 めぐるはめぐる (3) - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ // inabameguru const char sos[6] = { '-', 'g', 'n', 'b', 'm', 'r' }; const char bos[6] = { 'a', 'a', 'i', 'u', 'u', 'e' }; typedef long long ll; const ll P0 = 4561, P1 = 5347; const ll MOD0 = 1000000007, MOD1 = 1000000009; /* typedef */ typedef vector vs; typedef map mli; /* global variables */ int sis[6], bis[6]; mli rhm0, rhm1; /* subroutines */ void rhash(string &s, ll &rh0, ll &rh1) { rh0 = rh1 = 0; for (int i = 0; i < s.size(); i++) { rh0 = (rh0 * P0 % MOD0 + s[i]) % MOD0; rh1 = (rh1 * P1 % MOD1 + s[i]) % MOD1; } } /* main */ int main() { int n; cin >> n; vs sns; for (int i = 0; i < n; i++) { string s; cin >> s; sns.push_back(s); ll rh0, rh1; rhash(s, rh0, rh1); rhm0[rh0] = i; rhm1[rh1] = i; } for (int i = 0; i < 6; i++) sis[i] = bis[i] = i; do { do { string s; for (int i = 0; i < 6; i++) { if (sos[sis[i]] != '-') s += sos[sis[i]]; s += bos[bis[i]]; } ll rh0, rh1; rhash(s, rh0, rh1); mli::iterator mit0 = rhm0.find(rh0); if (mit0 == rhm0.end() || sns[mit0->second] != s) { mli::iterator mit1 = rhm1.find(rh1); if (mit1 == rhm1.end() || sns[mit1->second] != s) { cout << s << endl; return 0; } } } while (next_permutation(bis, bis + 6)); } while (next_permutation(sis, sis + 6)); return 0; }