try: while True: size = int(input()) field = [] for i in range(size): field.append(input()) c1, c2, c3 = set(field[0]), set(field[1]), set(field[2]) if c1 == c2: c = c1 elif c1 == c3: c = c1 else: c = c2 for i, row in enumerate(field): if set(row) != c: char = list(c - set(row))[0] wrong_char = list(set(row) - c)[0] print(i+1, row.index(wrong_char)+1, char) break except EOFError: pass