S=input() A,B=min(S),max(S) if S.count(A)==1: print(S.index(A)+1,A) else: print(S.index(B)+1,B)