var reader = require ('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

var lines = []; 
reader.on('line', (line) => {
    lines.push(line) ;
});

reader.on ('close', () => {
    var S = lines[0];
    var a =[S];
  for (var i = 0; i < 100; i++) {
  if (a[i]%2==0) { 
    var T = a[i]/2;
    a.push(T)
  } else if (a[i]%2 == 1) {
    var T = 3*a[i]-2;
    a.push(T)
  }
  }
  console.log(a)
  });