while 1: s=input() for i in range(len(s)):x=s[:i]+s[i+1:];list(x)==sorted(x)and print(s[i])