#include using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; string a[n][n]; REP(i, n) { REP(j, n) cin >> a[i][j]; } vector candidate; REP(j, n) { int cnt = 0; REP(i, n) { if (a[i][j] == "nyanpass") cnt++; } if (cnt == n - 1) candidate.push_back(j + 1); } if (candidate.size() == 1) { cout << candidate[0] << endl; } else { cout << -1 << endl; } return 0; }