#include "bits/stdc++.h" #ifndef err #define err(...) #define DebugWriteLine(...) #endif using namespace std; void Calc(); #define ALL(win) begin(win),end(win) #define RALL(win) (win).rbegin(),(win).rend() typedef int64_t ll; typedef uint64_t ull; int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cin.exceptions(istream::failbit | istream::badbit); Calc(); cout.flush(); return 0; } template struct Iter { T&operator++() { return ++i; } constexpr const T&operator*() const { return i; } constexpr bool operator!=(const Iter &o) const { return i != o.i; } T i; }; struct Scanner { templatestatic A Next() { A a; cin >> a; return a; } templatestatic vector Array(int n) { vector a(n); for (A&i : a) cin >> i; return a; } static string Line() { string s; getline(cin, s); return s; } static int Int() { return Next(); } templateScanner&operator,(A&a) { a = Next(); return *this; } templateoperator A() { return Next(); } }in; /*---------------------------------------------------------------------*/ void Calc() { int n = in; vector is_rentyon(n, 1); for (int j = 0; j < n; j++) { for (int i = 0; i < n; i++) { string s = in; if (s == "-") continue; if (s != "nyanpass") is_rentyon[i] = 0; } } int cnt = 0; for (auto& i : is_rentyon) { cnt += i; } if (cnt == 1) { for (int i = 0; i < n; i++) { if (is_rentyon[i]) { cout << i + 1 << endl; } } } else { cout << -1 << endl; } }