There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N).  For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.  We say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:    * For every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.  Does there exist a good set of choices? If the answer is yes, find one good set of choices.
N = int(input())
A = list(map(int, input().split()))
A.insert(0, 0)
B = [0] * (N + 1)
for i in range(N, 0, -1):
  j = i * 2
  sum = 0
  while (j <= N):
    sum += B[j]
    j += i
  B[i] = (sum + A[i]) % 2
ans = ''
for i in range(1, N + 1):
  if B[i] == 1:
    ans += str(i) + ' '
print(0 if ans == '' else ans.strip())
N = int(input())
A = list(map(int, input().split()))
A.insert(0, 0)
B = [0] * (N + 1)
for i in range(N, 0, -1):
  j = i * 2
  s = 0
  while (j <= N):
    s += B[j]
    j += i
  B[i] = (s + A[i]) % 2
print(sum(B))
if sum(B) > 0:
  ans = ''
  for i in range(1, N + 1):
    if B[i] == 1:
      ans += str(i) + ' '
  print(ans.strip())