using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace foryuki { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); bool[] b = new bool[n]; for (int i = 0; i < b.Length; i++) { b[i] = true; } for (int i = 0; i < n; i++) { string[] s = Console.ReadLine().Split(); for (int j = 0; j < s.Length; j++) { if (s[j] != "nyanpass") { if (s[j] != "-") { b[j] = false; } } } } if (b.Where(x => x == true).Count() != 1) { Console.WriteLine(-1); } else { for (int i = 0; i < n; i++) { if (b[i]) { Console.WriteLine(i + 1); break; } } } } //------------------------------------------------------------- static int[] ConvertStringArrayToIntArray(string[] array) { return Array.ConvertAll(array, str => int.Parse(str)); } static List ConvertStringArrayToIntList(string[] str) { var list = new List(); foreach (var c in str) list.Add(int.Parse(c)); return list; } } }