#include #define REP(i, n) for(int i=0; i<(n); i++) #define REP2(i, x, n) for(int i=x; i<(n); i++) using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; string s; set st; bool flag = false; REP( i, n ){ REP( j, n ){ cin >> s; if( s == "nyanpass" ){ st.insert( j ); flag = true; }else{ if( flag ){ st.erase( j ); } } } } for( auto x : st ){ if( st.size() == 1 ){ cout << x + 1 << endl; return 0; } } cout << -1 << endl; return 0; }