from collections import * S = list(input()) C = Counter(S) v = C.most_common()[1][0] print(S.index(v) + 1, v)