#include using namespace std; typedef long long ll; int main() { int n; cin >> n; vector< vector > a(n, vector(n)); for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { cin >> a[i][j]; } } string t = "nyanpass"; int ans = -1; bool is_valid = true; for (int i = 0; i < n; ++i) { int cnt = 0; for (int j = 0; j < n; ++j) { if (a[j][i] == t) cnt++; } if (ans != -1 && cnt == n - 1) is_valid = false; if (cnt == n - 1) ans = i + 1; } if (ans != -1 && is_valid) cout << ans << '\n'; else puts("-1"); return 0; }