fun main(args: Array<String>) {
    val mod = 1000000007L
//    val (N,D) = readLine()!!.split(" ").map { it.toInt() }
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map { it.toInt() }.toList()

    val set = mutableSetOf<Int>()

    for (i in N downTo 1) {
        var tmp = A[i-1]
        for (j in 2 until N/i+1) {
            if (set.contains(i*j)) tmp++
        }

        if (tmp%2 == 1)
            set.add(i)
    }

    println(set.size)
    println(set.joinToString(" "))
}

