Imports System.Collections.Generic
Public Class Program
  Shared Sub Main()
    Dim n As Integer = Integer.Parse(Console.ReadLine())
    Dim arrayA As Integer() = Array.ConvertAll(Of String, Integer)(Console.ReadLine().Split(" "), AddressOf Integer.Parse)
    Dim m As Integer = 0
    Dim b(0 To n - 1) As Integer
    Dim listB As List(Of String) = New List(Of String)
    For i As Integer = n To 1 Step -1
      b(i - 1) = arrayA(i - 1)
      For j As Integer = 2 To n 
        Dim k As Long = j * i
        If k <= n Then b(i - 1) = b(i - 1) Xor b(k - 1)
      Next
      If b(i - 1) = 1 Then 
        m += 1
        listB.Insert(0, i.ToString())
      End If
    Next
    Console.WriteLine(m.ToString())
    If m <> 0 Then Console.WriteLine(String.Join(" ", listB))
  End Sub
End Class