using System; class Program { static void Main() { int N = int.Parse(Console.ReadLine()!); string[][] A = new string[N][]; for (int i = 0; i < N; i++) { A[i] = Console.ReadLine()!.Split(); } int renchons = -1; for (int i = 0; i < N; i++) { bool isRenchon = true; for (int j = 0; j < N; j++) { if (i == j) continue; // 自分自身は無視 if (A[i][j] != "nyanpass") { isRenchon = false; break; } } if (isRenchon) { if (renchons != -1) { // すでに1人候補がいた場合、複数 → 特定できない renchons = -1; break; } else { renchons = i + 1; // 1-indexed } } } Console.WriteLine(renchons); } }