S=input() [a,b]=list(set(S)) if S[:3].count(a)>=2: x=b else: x=a print(S.index(x)+1,x)