#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; } } int test = 0; for(int it:arr)if(it == 2)test++; if(test != 1){ cout << -1; return 0; } for(int i = 0; i < n; i++) { if(arr[i] == 2){ cout << i + 1; return 0; } } return 0; }