s = input() t = list(set(s)) if s.count(t[0]) > s.count(t[1]): print(s.index(t[1]) + 1, t[1]) else: print(s.index(t[0]) + 1, t[0])