#include #include #include using namespace std; int main(void) { int n; cin >> n; vector candidates(n, 1); string s; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { cin >> s; if (s != "nyanpass" && s != "-") candidates[j] = 0; } } int id = 0; for (int i = 0; i < n; ++i) if (candidates[i] == 1) id = i + 1; int renchon = count(candidates.begin(), candidates.end(), 1); if (renchon == 1) cout << id << endl; else cout << -1 << endl; return 0; }