#include using namespace std; int main(){ int n; cin >> n; int talk[n]; fill(talk, talk + n, 0); string str; for(int i = 0; i < n; i++){ for(int i = 0; i < n; i++){ cin >> str; if(str == "nyanpass")talk[i]++; } } int renchon = 0; for(int i = 0; i < n; i++){ if(talk[i] == n - 1)renchon++; } if(renchon == 1){ for(int i = 0; i < n; i++){ if(talk[i] == n - 1)cout << i + 1 << endl; } }else{ cout << "-1" << endl; } }