
function Main(input) {
    var N = parseInt(input[0], 10);
    var A = input.slice(1).map(a => parseInt(a, 10));

    var goodArray = new Array(N);
    var sum = 0;
    var times = 2;
    var index = 0;

    for (var i = N; i > 0; i--) {
        sum = 0;
        times = 2;
        index = times * i;
        while(index <= N) {
            sum += goodArray[index - 1];
            times++;
            index = times * i;
        }
        if ((A[i - 1]) % 2 === 0) {
            goodArray[i - 1] = sum % 2 === 0 ? 0 : 1;
        } else {
            goodArray[i - 1] = sum % 2 === 0 ? 1 : 0;
        }
    }

    var result = 0;
    for (var j = 0; j < N; j++) {
        result += goodArray[j];
    }

    if (result === 0) {
        return console.log(0);
    } else {
        console.log(result);
    }

    console.log(goodArray.filter(num => num === 1).join(' '));
  }

  Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));