#include #include int main(void){ int i, j; int N, n = 0, num; char A[31]; int S[101] = {}; scanf("%d", &N); for(i = 1; i <= N; i++){ for(j = 1; j <= N; j++){ scanf("%s", A); if(i != j && strcmp(A, "nyanpass") == -1){ S[j] = 1; } } } for(i = 0; i < N; i++){ if(S[i] == 0){ n++; num = i; } } if(n == 1) printf("%d\n", num); else printf("-1\n"); return 0; }