a = int(input("Digite o número: "))
while a!=1:
    if a%2==0:
        b=a/2
    else:
        b=3*a+1
    print(int(b))
    a=b
