x=input() while x>1:print x;x=3*x+1 if x%2 else x/2 print 1