def hs (n):
    if (n > 0 and type (n) == int):
        length = 0
        while (n != 1):
            print(n)
            length = length + 1
            if (n % 2 == 0):
               n = n // 2
            else:
                n = 3*n + 1
        if (n == 1):
            print(n)
            print(length + 1)
    else:
        print("Needs a positive integer")
