#include #include using namespace std; int main(){ int count,n,p = -1; cin >> n; int v[n]; string s[n][n]; for(int i = 0;i < n;i++){ for(int j = 0;j < n;j++){ cin >> s[i][j]; if(s[i][j] == "nyanpass") v[j]++; } } for(int i = 0;i < n;i++){ if(v[i] == n - 1){ if(p == -1) p = i + 1; }else{ p = -1; break; } } cout << p << endl; }