var try_count = 0;
function Main(input) {
  var input_splited = input.split('\n');
  var n = input_splited[0];
  var a_array = input_splited[1].split(' ');
  var half_a_array = [];
  
  var all_even = true;
  for (var i = 0; i < a_array.length; i+=1) {
    var n_a = parseInt(a_array[i], 10);
    if (n_a % 2 != 0) {
      all_even = false;
      break;
    } else {
      half_a_array.push(n_a / 2);
    }
  }
 
  if (!all_even) {
    console.log(try_count);
    return;
  }

  try_count += 1;
  var next_input = n+'\n'+half_a_array.join(' ');
  Main(next_input);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));