using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Magatro { static void Main() { int N = int.Parse(Console.ReadLine()); string[][] A = new string[N][]; int nyanpass = -1; for(int i = 0; i < N; i++) { string[] a = Console.ReadLine().Split(' '); A[i] = a; } for(int i = 0; i < N; i++) { bool nyanpath = true; for(int j = 0; j < N; j++) { if (i == j) { continue; } if(A[j][i]!= "nyanpass") { nyanpath = false; } } if (nyanpath) { if (nyanpass == -1) { nyanpass = i + 1; } else { Console.WriteLine(-1); return; } } } Console.WriteLine(nyanpass); } }