Sharkovskii order by hallvabo

f=lambda n,c=0:n%2*((c,9-c)[n<2],n)or f(n/2,c+1)
for e in sorted(map(int,open('/dev/fd/0')),key=f):print e

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

download

return top