

function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  var a = input[1].split(" ").map(i => parseInt(i));
  var bb = new Array(N).fill(0);
  var bsub = new Array();
  var num = 0;
  for(var i=N;i>0;i--){
    var cnt =0;
    for(var j=1;j*i<=N;j++){
      cnt+=bb[j*i-1];
    }
    if(cnt%2!=a[i-1]){
      num++;
      bsub.push(i);
      bb[i-1]++;
    }
  }
  var b = bsub.join(" ");
  var ans = num+"\n"+b;
  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));