#include #include #include #include #include #include #include #include #include using namespace std; #define REP(i, j) for (int i = 0; i < (int)j; ++i) #define FOR(i, j, k) for (int i = (int)j; i < (int)k; ++i) #define SORT(v) sort(v.begin(), v.end()) #define REVERSE(v) reverse(v.begin(), v.end()) typedef complex P; typedef vector VI; typedef long long LL; typedef pair PII; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector> v(n, vector(n)); REP(i,n) { REP(j,n) { string a; cin >> a; v[i][j] = a; } } VI ncnt(n,0); REP(j,n) { REP(i,n) { if (v[i][j] == "nyanpass") ncnt[j]++; } } int cnt = 0, ans; REP(i,n) { if (ncnt[i] == (n - 1)) { cnt++; ans = i + 1; } } if (cnt == 1) cout << ans << endl; else cout << -1 << endl; return 0; }