X = 6 # alkuarvo while True: print(X, end=' ') if X == 1: break if X % 2 == 0: X = X // 2 else: X = 3 * X + 1