1 2 3 4 5 6 7 8
a = int( raw_input( 'Enter number: ') ) while a != 4: print a, if a % 2 == 1: a = a * 3 + 1 else: a /= 2 print 4, 2, 1