n = int(input())
list1 = [n]
if n == 1:
print(1, end='')
else:
while n != 1:
if n % 2 == 0:
n = n % 2
list1.append(n)
else:
n = 3*n+1
list1.append(n)
list1.reverse()
for i in range(len(list1)):
if i != len(list1)-1:
print(list1[i], end=' ')
else:
print(list1[i], end='')
模2后得到0向列表里添加时会一直响应,导致了超时请问佬们是什么原因