a=input(), while 1:a+=a[-1][1:]or 0in map(print,sorted(a)),