while 1: q=0 for c in raw_input(): if q>c:print(q+c)[p>c] p,q=q,c