input_count = input('自然数')
 
i = int(input_count)
while i!=1:
    if i%2==1:
        i = 3*i-1
    else:
        i = i//2
    print(i)