#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP(i,n) for(int i=0;i( \ ( std::ostringstream() << std::dec << x ) ).str() #define ALL(s) (s).begin(), (s).end() using namespace std; typedef long long unsigned int llu; typedef long long ll; int main (){ int N; while (cin >> N){ bool* vill = new bool[N]; REP(i,N)vill[i] = true; REP(i,N){ REP(j,N){ string a; cin >> a; if(a == "-")continue; else if(a != "nyanpass")vill[j] = false; } } int ans = -1; REP(i,N){ if(vill[i]){ if(ans == -1){ ans = i + 1; } else{ ans = -1; break; } } } cout << ans << endl; } return 0; }