#include #include #include #include using namespace std; int main() { int N; string str; cin >> N; vector > A(N + 1, vector(N + 1, 0)); for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { cin >> str; A[j][i] = (str == "nyanpass" ? 1 : 0); } } int nyancount = 0, nyan; for (int i = 1; i <= N; i++) { if (accumulate(A[i].begin(), A[i].end(), 0) == N - 1) { nyancount++; nyan = i; } } if (nyancount == 1) cout << nyan << endl; else cout << -1 << endl; return 0; }