using System; class Program { static void Main(string[] args) { int total = int.Parse(Console.ReadLine()!); string[,] wordArray = new string[total, total]; for (int i = 0; i < total; i++) { string[] input = Console.ReadLine()!.Split(' '); for (int j = 0; j < input.Length; j++) { wordArray[i, j] = input[j]; } } int ans = 0; int count = 0; for (int i = 0;i < total; i++) { int wordCount = 0; for (int j = 0; j < total; j++) { if (wordArray[j, i] == "nyanpass" || wordArray[j, i] == "-") { wordCount++; } } if (wordCount == total) { count++; ans = i + 1; } } if (count == 1 && ans != 0) { Console.WriteLine(ans); } else { Console.WriteLine(-1); } } }