#include #include #include using namespace std; int main() { int n; cin >> n; string s[n][n]; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { cin >> s[i][j]; } } int count = 0; map m; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { if (s[i][j] == "nyanpass") { m[j]++; } } } int ans=0; for (int j = 0; j < n; ++j) { if (m[j] == n - 1 && count == 0) { count++; ans=j; } else if (m[j] == n - 1 && count == 1) { cout << -1 << endl; return 0; } } if (count == 1) { cout << ans + 1 << endl; } else { cout << -1 << endl; return 0; } }