import time a = int(input()) while a != 1 : if a % 2 == 0: a = a/2 print(a) else : a = 3*a + 1 print(a) time.sleep(0.5) else: print(a)