#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); int memo[12] = {50965598, 138640614, 86894790, 22969011, 137866584, 12805388, 102696496, 169269628, 196679944, 213985204, 79308356}; 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); } if (hash.size() >= 129599) { puts("NO"); return 0; } int ind1[6], ind2[6]; for (int i = 0; i < 6; i++) { ind1[i] = i; ind2[i] = i; } char str[12] = "inabameguru"; do { do { char ans[12]; int temp = 0; for (int i = 0; i < 6; i++) { temp += str[ind1[i]<<1]*memo[i<<1]; ans[i<<1] = str[ind1[i]<<1]; } for (int i = 0; i < 5; i++) { temp += str[(ind2[i]<<1)+1]*memo[(i<<1)+1]; ans[(i<<1)+1] = str[(ind2[i]<<1)+1]; } ans[11] = '\0'; if (hash.find(temp) == hash.end()) { puts(ans); return 0; } for (int i = 0; i < 10; i++) { temp += ans[i]*memo[i+1]-ans[i]*memo[i]; temp += ans[i+1]*memo[i]-ans[i+1]*memo[i+1]; swap(ans[i], ans[i+1]); if (hash.find(temp) == hash.end()) { puts(ans); return 0; } } } while(next_permutation(ind2, ind2+5)); } while(next_permutation(ind1, ind1+6)); }