S = input() d = dict() c = dict() for i, s in enumerate(S): if s not in d: d[s] = i c[s] = 0 c[s] += 1 for cc, dd in zip(c, d): if c[cc]==1: print(d[dd]+1, dd) exit()