#include #include using namespace std; int main() { int n; cin >> n; string a[100][100]; for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) cin >> a[i][j]; int res = -1; for (int i = 0; i < n; ++i) { bool flg = true; for (int j = 0; j < n && flg; ++j) { if (a[j][i] != "nyanpass" && i != j) { flg = false; } } if (flg) { if (res == -1) { res = i + 1; } else { cout << -1 << endl; return 0; } } } cout << res << endl; return 0; }