using System; using System.Collections.Generic; using System.Linq; namespace Test { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); bool[] ret = new bool[n]; for (int i = 0; i < n; i++) ret[i] = true; for (int i = 0; i < n; i++) { string[] s = Console.ReadLine().Split(); for (int j = 0; j < n; j++) { if (i == j) continue; else if (!(s[j] == "nyanpass" || s[j] == "-")) ret[j] = false; } } int a = -1; for (int i = 0; i < n; i++) { if (ret[i]) { if (a == -1) { a = i + 1; } else { a = 999; } } } Console.WriteLine(a <= 100 ? a : -1); } } }