#include #include #include using namespace std; int main() { int n; cin >> n; vector> a(n,vector(n,"")); vector arr(n,0); for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ cin >> a[i][j]; if(a[i][j] == "nyanpass") arr[j] += 1; } } bool f = false; for(int it:arr) { if(it == (n-1) && !f){ f = true; } else if (it == (n-1) && f) { cout << -1; return 0; } } for(int i = 0; i < n; i++) { if(arr[i] == (n-1)){ cout << i + 1; return 0; } } cout << -1; return 0; }