#include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(i,s,e) for (int i = int(s); i != int(e); i++) #define FORIT(i,c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); i++) #define ISEQ(c) (c).begin(), (c).end() int main(){ int N; cin >> N; string s[N][N]; FOR(i,0,N){ FOR(j,0,N){ cin >> s[i][j]; } } bool isNyanpass[N]; FOR(j,0,N){ isNyanpass[j] = true; FOR(i,0,N){ if(i != j && s[i][j] != "nyanpass"){ isNyanpass[j] = false; } } } int ans = -1; FOR(i,0,N){ if (isNyanpass[i]){ if(ans == -1) ans = i+1; else{ ans = -1; break; } } } cout << ans << endl; return 0; }