#include #include #include #include #include #include using namespace std; int main() { int n; string str; cin >> n; vector isRen(n, true); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> str; if (str == "-") { continue; } else if (str != "nyanpass") { isRen[j] = false; } } } int cnt = 0; int idx = -1; for (int i = 0; i < n; i++) { if (isRen[i]) { idx = i + 1; cnt++; } } cout << (cnt == 1 ? idx : -1) << endl; return 0; }