#!/usr/bin/python3
def collatz():
    try:
        number = int(input("Please enter a number: "))
        while number != 1:
            if number % 2 == 0:
                number /= 2
                print(number)
            else:
                number = 3 * number + 1
                print(number)
    except(ValueError):
        print("Enter an integer")

collatz()
