#include #include #include #include #include #include #include #include #include #include using namespace std; //#define __int64 long long #define long __int64 #define REP(i,a,b) for(int i=a;i > s; vector s2; string in; string d1,d2; string data = "inabameguru"; string data1 = "aaeiuu"; string data2 = "bgmnr"; string check; string c = "aaaaaa"; char check1[6] = {'a','a','e','i','u','u'}; char check2[5] = {'b','g','m','n','r'}; bool flg = true; cin >> n; for(int i=0; i> in; d1 = ""; d2 = ""; for(int ii=0; ii<5; ii++){ d1 += in[ii*2]; d2 += in[ii*2+1]; } d1 += in[10]; s.push_back( make_pair(d1, d2) ); s2.push_back(in); } sort(s.begin(), s.end()); sort(s2.begin(), s2.end()); int cnt = 0; do{ for(int i=0; i<5; i++){ check2[i] = data2[i]; } do{ flg = false; vector< pair >::iterator itr = s.begin(); for(int i=0; isecond[i]){ flg = true; break; } } if(flg){ for(int i=0; i<5; i++){ cout << check1[i]; cout << check2[i]; } cout << check1[5] << endl; } cnt ++; }while( next_permutation(check2, check2 + 5) && !flg); }while( next_permutation(check1, check1 + 6) && !flg); if(!flg){ cout << "NO" << endl; } return 0; }