using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoderTest { class Program { static void Main(string[] args) { string input = Console.ReadLine(); int n = int.Parse(input); int[] cnt = new int[n]; for (int i = 0; i < n; i++) { string[] aisatu = Console.ReadLine().Split(' '); for (int j = 0; j < n; j++) { if (aisatu[j] == "nyanpass") { cnt[j]++; } } } int max = -100; int ren = -1; bool flg = false; for (int i = 0; i < n; i++) { if (cnt[i]==n-1&&flg==false) { max = cnt[i]; ren = i; flg = true; } else if (cnt[i] == max&&flg==true) { ren = -1; break; } } if (ren != -1) { Console.WriteLine(ren + 1); } else { Console.WriteLine(ren); } } } }