def c(x): print(x, end=' ' if x!=1 else '\n') if x!=1: c(3*x+1 if x%2 else x//2) c(X)