#include using namespace std; int main(){ int N; cin >> N; vector> A(N, vector(N)); for (int i = 0; i < N; i++){ for (int j = 0; j < N; j++){ cin >> A[i][j]; } } vector ans; for (int i = 0; i < N; i++){ bool ok = true; for (int j = 0; j < N; j++){ if (j != i){ if (A[j][i] != "nyanpass"){ ok = false; } } } if (ok){ ans.push_back(i); } } if (ans.size() == 1){ cout << ans[0] + 1 << endl; } else { cout << -1 << endl; } }