fun intList() = readLine()?.split(" ")?.map(String::toInt) ?: TODO()
fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val a = intList()
    val box = Array(n) { 0 }
    (n - 1).downTo(0).forEach { i ->
        var balls = a[i]
        var multiple = 2
        while ((i + 1) * multiple <= n) {
            balls += box[(i + 1) * multiple - 1]
            multiple++
        }
        box[i] = balls % 2
    }
    val m = box.count { it == 1 }
    if (m == 0) {
        println("0")
    } else {
        println(
            """
        $m
        ${box.mapIndexedNotNull { i, v ->
                if (v == 1) {
                    i + 1
                } else {
                    null
                }
            }.joinToString(separator = " ")}
    """.trimIndent()
        )
    }
}
