using System; using System.Linq; // 追加 public class Program { public void Solve() { int N = int.Parse(Console.ReadLine()); int[] arr = new int[N]; string[] A; for (int i = 0; i < N; i++) { A = Console.ReadLine().Split(' '); for (int j = 0; j < N; j++) { if (A[j].Equals("nyanpass")) { arr[j]++; } } } if (arr.Where(x => x == N - 1).Count() == 1) { Console.WriteLine(Array.IndexOf(arr, N - 1) + 1); } else { Console.WriteLine(-1); } } public static void Main(string[] args) { Program solver = new Program(); solver.Solve(); } }