S = input().strip() unique_chars = list(set(S)) # Since the problem states there are exactly two unique characters, we can safely proceed count = {} for c in S: count[c] = count.get(c, 0) + 1 # Find which character has a count of 1 target_char = unique_chars[0] if count[unique_chars[0]] == 1 else unique_chars[1] # Find the 1-based index of the target character for idx, c in enumerate(S, 1): if c == target_char: print(f"{idx} {c}") break