#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int N; cin >> N; vector> A(N, vector(N)); rep(i,N)rep(j,N) cin >> A[i][j]; vector can; rep(j,N) { int ok = 1; rep(i,N) ok &= A[i][j] == "nyanpass" || A[i][j] == "-"; if(ok) can.push_back(j + 1); } if(can.size() != 1u) cout << -1 << endl; else cout << can[0] << endl; }