#include using namespace std; // #define int long long /* short */ #define pb push_back #define print(Target) cout << Target << '\n' /* REPmacro */ #define REP(i, n) for (int i = 0; i < (n); i++) #define REPS(i, a, n) for (int i = (a); i < (n); i++) /* typedef */ typedef long long ll; typedef unsigned long long ull; typedef vector vi; typedef vector > vii; typedef pair pii; /* func */ inline bool is_uruu(int y) {return (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));} /* const */ const int INF = INT_MAX; signed main() { ios::sync_with_stdio(false); int n; cin >> n; vector flg(n, false); REP(i, n){ REP(j, n){ string s; cin >> s; if (s == "nyanpass"){ flg[j] = true; } } } int sum = 0; REP(i, n){ sum += flg[i]; } if (sum != 1){ print("-1"); }else { REP(i, n){ if (flg[i]){ print(i + 1); break; } } } return (0); }