N=int(input()) M=N S=str(N) for i in range(0,len(S)): for j in range(i+1,len(S)): if S[i]N: break print(M)