#include #include typedef unsigned long long ul; typedef signed long long ll; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(2); int n; std::cin >> n; bool canbe[n]; std::fill(canbe, canbe+n, true); for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { std::string s; std::cin >> s; if (i==j) continue; if (s != "nyanpass") canbe[j] = false; } } int ans = -1; for (int i = 0; i < n; ++i) { if (canbe[i]) { if (ans != -1) {std::cout << -1 << std::endl; return 0;} ans = i; } } std::cout << ans << std::endl; return 0; }