#define _CRT_SECURE_NO_WARNINGS #include #include int main(void) { int i, j, k, N, renchon, meetings = 0; int suspects[100] = { 0 }; char target[8] = { 'n', 'y', 'a', 'n', 'p', 'a', 's', 's' }; char table[100][30]; scanf("%d", &N); for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { scanf("%s", &table[i]); if (strncmp(table[i], target, 8) == 0) suspects[j]++; } } for (k = 0; k < N; k++) { if (suspects[k] == N - 1) { meetings++; renchon = k + 1; } } if (meetings == 1) { printf("%d\n", renchon); } else puts("-1"); return 0; }