from collections import Counter S = list(input()) n = len(S) counter = Counter(S) ans = '' for v, cnt in counter.items(): if cnt == 1: ans = v for i in range(n): if S[i] == ans: print(i + 1, ans) break