let n = read_int ()
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let bs = Array.make n 0
let _ = for k = n downto 1 do let s, i = ref 0, ref 2 in while !i * k <= n do s := !s + bs.(!i * k - 1); incr i done; bs.(k - 1) <- if !s mod 2 = a_s.(k - 1) mod 2 then 0 else 1 done; Array.(Printf.printf "%d\n" @@ fold_left (+) 0 bs; iteri (fun i b -> if b = 1 then Printf.printf "%d " (i + 1)) bs)