import java.util.Scanner; import java.util.HashMap; public class Tribune { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNextInt()) { int n = sc.nextInt(); HashMap hm = new HashMap<>(); HashMap hmPosX = new HashMap<>(); HashMap hmPosY = new HashMap<>(); char [][] p = new char[n][n]; for (int i = 0; i < n; i++) { String s = sc.next(); p[i] = s.toCharArray(); int k = 0; for (char c : s.toCharArray()) { if (hm.containsKey(c)) { int j = hm.get(c); j++; hm.replace(c, j); } else { hm.put(c, 1); } hmPosY.put(c, i); hmPosX.put(c, k); k++; } } char z = 'c'; char d = 'd'; for (char c : hm.keySet()) { if (hm.get(c) == 1) { z = c; } else if (hm.get(c) == n - 1) { d = c; } } System.out.println((hmPosY.get(z) + 1) + " " + (hmPosX.get(z) + 1) + " " + d); } } }