+−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