from collections import Counter s = input() c = Counter(s) mn = 10**18 mnc = '' for k, v in c.items(): if v < mn: mnc = k res = -1 for i in range(len(s)): if s[i] == mnc: res = i+1 print(res, mnc)