main=readLn>>=mapM print.f f 1=[1] f x|odd x=x:f(3*x+1)|1>0=x:f(x`div`2)