#include #include using namespace std; int main() { int n; cin >> n; vector> v(n, vector(n)); for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ cin >> v[i][j]; } } int num = 0; int man = -1; for(int j = 0; j < n; j++){ bool ok = true; for(int i = 0; i < n; i++){ if(i != j and v[i][j] != "nyanpass"){ ok = false; } } if(ok){ num++; man = j; } } if(num == 1){ cout << man+1 << endl; } else { cout << -1 << endl; } return 0; }