d=s='' for c in raw_input():s+=min(c,d);d=max(c,d) print s+d