# Given any whole number n

# if n is odd - 3n+1 if n is even - n/2

# I wrote some code to do this for any number.

n = int(input("Enter an integer"))
print(n)
while n!= 1:
	if(n%2 == 0):
		n=n/2
		print(n)
	else:
		n = (3*n)+1
		print(n)



n = int(input("Enter an integer"))
print(n)
while n!=1:
	if(n%2 == 0):
		n=n/2
		print(n)
	else:n =(3*n)+1
	print(n)


n = int(input("Enter an integer"))
print(n)
while n!=1:
	if(n%2 == 0):
		n=n/2
		print(n)
	else:
		n=(3*n)+1
		print(n)


n = int(input("Enter an integer"))
print(n)
while n!=1:
	if(n%2 ==0):
		n=n/2
		print(n)
	else:
		n = (3*n)+1
		print(n)