#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int main() { int n; scanf("%d", &n); if (n >= 230400) { puts("NO"); return 0; } int memo[12] = {4331, 16048, 21792, 22962, 24977, 2984, 24324, 6723, 1211, 29381, 29059, 9149}; set hash; for (int i = 0; i < n; i++) { char s[12]; scanf("%s", s); int t = 0; for (int j = 0; j < 12; j++) { t += s[j]*memo[j]; } hash.insert(t); } int ind1[6], ind2[6]; for (int i = 0; i < 6; i++) { ind1[i] = i; ind2[i] = i; } char str[12] = "inabameguru"; do { do { int temp = 0; for (int i = 0; i < 6; i++) { temp += str[ind1[i]*2]*memo[i*2]; } for (int i = 0; i < 5; i++) { temp += str[2*ind2[i]+1]*memo[2*i+1]; } if (hash.find(temp) == hash.end()) { char ans[12]; for (int i = 0; i < 6; i++) { ans[i*2] = str[ind1[i]*2]; } for (int i = 0; i < 5; i++) { ans[2*i+1] = str[2*ind2[i]+1]; } ans[11] = '\0'; puts(ans); return 0; } } while(next_permutation(ind2, ind2+5)); } while(next_permutation(ind1, ind1+6)); reverse(ind1, ind1+6); reverse(ind2, ind2+5); do { do { int temp = 0; for (int p = 0; p <= 10; p+=2) { for (int i = 1; i <= 10; i++) { for (int j = 0; j <= 5; j++) { if (2*j >= i) { temp += str[2*ind1[j]+1]*memo[2*j+1]; }else { temp += str[2*ind1[j]]*memo[2*j]; } if (2*j+1 >= i) { temp += str[2*ind2[j]+2]*memo[2*j+2]; }else { temp += str[2*ind2[j]+1]*memo[2*j+1]; } } temp += str[p]*memo[i]; if (hash.find(temp) == hash.end()) { char ans[12]; for (int j = 0; j <= 5; j++) { if (2*j >= i) { ans[2*j+1] = str[2*ind1[j]+1]; }else { ans[2*j] = str[2*j]; } if (2*j+1 >= i) { ans[2*j+2] = str[2*j+2]; }else { ans[2*j+1] = str[2*j+1]; } } ans[i] = str[p]; puts(ans); return 0; } } } } while(next_permutation(ind2, ind2+5)); } while(next_permutation(ind1, ind1+5)); }