#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) const double PI = acos(-1); int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector v(n, true); REP (i, n) { REP (j, n) { string s; cin >> s; if (j != i && s != "nyanpass") v[j] = false; } } if (count(v.begin(), v.end(), true) == 1) cout << find(v.begin(), v.end(), true) - v.begin() + 1 << endl; else cout << -1 << endl; return 0; }