Presort array by Puzzlet Chung

import re
while 1:print'[%s]'%re.sub('[] []','',repr(sorted(reduce(lambda a,b:[a[:-1]+[a[-1]+[b]],a+[[b]]][a[-1][-1]>b],eval(raw_input()),[[999]])[1:])))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top