# -*- coding: utf-8 -*-
"""
Created on Sat Feb 3 12:59:09 2018
@author: He Yuanwei
"""
def collatz(number):
try:
if number%2 == 0:
return number//2
elif number%2 == 1:
return 3*number + 1
except:
print('Please input an integer!')
number = int(input('Enter number:\n'))
while number!=1 :
print (collatz(number))
number = collatz(number)