from string import ascii_lowercase S=input() D={x:0 for x in ascii_lowercase} for s in S: D[s]+=1 alpha=min(D,key=lambda x:D[x]) beta =max(D,key=lambda x:D[x]) print("{}to{}".format(alpha,beta))