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<>(); for (int i = 0; i < n; i++) { String s = sc.next(); for (int k = 0; k < n; k++) { char c = s.charAt(k); 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); } } } char z = 'c'; char d = 'd'; n--; for (char c : hm.keySet()) { if (hm.get(c) == 1) { z = c; } if (hm.get(c) == n) { d = c; } } System.out.println((hmPosY.get(z) + 1) + " " + (hmPosX.get(z) + 1) + " " + d); } } }