N = int(eval(input()))

A = list(map(int, input().split()))

B = [0 for n in range(N+1)]

x = []



for n in range(N):

  i = N-n

  # print(i)

  BB = B[::i]

  if (sum(BB))%2 == A[i-1]:

    B[i] = 0

  else:

    B[i] = 1

    # print(B)

  if B[i] == 1:

    x.append(str(i))

  

if len(x) == 0:

  print((0))

else:

  print((len(x)))

  print((' '.join(x)))
N = int(eval(input()))

A = list(map(int, input().split()))

B = [0]*(N+1)

x = []



for n in range(N):

  i = N-n

  BB = B[::i]

  if (sum(BB))%2 == A[i-1]:

    B[i] = 0

  else:

    B[i] = 1

    x.append(str(i))

  

if len(x) == 0:

  print((0))

else:

  print((len(x)))

  print((' '.join(x)))
N = int(eval(input()))
A = list(map(int, input().split()))
B = [0 for n in range(N + 1)]
x = []
for n in range(N):
    i = N - n
    # print(i)
    BB = B[::i]
    if (sum(BB)) % 2 == A[i - 1]:
        B[i] = 0
    else:
        B[i] = 1
        # print(B)
    if B[i] == 1:
        x.append(str(i))
if len(x) == 0:
    print((0))
else:
    print((len(x)))
    print((" ".join(x)))

N = int(eval(input()))
A = list(map(int, input().split()))
B = [0] * (N + 1)
x = []
for n in range(N):
    i = N - n
    BB = B[::i]
    if (sum(BB)) % 2 == A[i - 1]:
        B[i] = 0
    else:
        B[i] = 1
        x.append(str(i))
if len(x) == 0:
    print((0))
else:
    print((len(x)))
    print((" ".join(x)))

-B = [0 for n in range(N + 1)] +B = [0] * (N + 1) -    # print(i) -        # print(B) -    if B[i] == 1: