import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); Map renchon = new HashMap<>(); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { String s = sc.next(); if (s.equals("nyanpass")) { if (!renchon.containsKey(j)) { renchon.put(j, 0); } renchon.put(j, renchon.get(j)+1); } } } int renchonNum = -1; boolean renchonFlag = false; for (int i = 0; i < N; i++) { if (!renchon.containsKey(i)) continue; if (renchon.get(i) == N - 1 && renchonNum == -1) { renchonNum = i; continue; } if (renchon.get(i) == N - 1 && renchonNum != 1) { renchonFlag = true; } } if (!renchonFlag) { System.out.println(renchonNum+1); } else { System.out.println("-1"); } } }