while 1: z=list(input()) for d in range(99): x=z[:d]+z[d+1:] if x==sorted(x):print(z[d])