import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); Set renchon = new HashSet<>(); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { String s = sc.next(); if (s.equals("nyanpass")) renchon.add(j+1); } } if (renchon.size() > 1 || renchon.size() == 0) { System.out.println("-1"); } else { renchon.forEach(System.out::println); } } }