N = int(eval(input()))

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



r = [0] * N





def f(n):

    """

    nの倍数のボールの数

    """

    cnt = 0

    i = 2

    while n * i <= N:

        cnt += r[n*i-1]

        i += 1

    return cnt





for i in range(N):

    n = N - i

    x = f(n)

    if x % 2 == A[n-1]:

        pass

    else:

        r[n-1] += 1



# print(r)



ans = []

for i, ri in enumerate(r):

    if ri == 1:

        ans.append(str(i+1))



if len(ans) == 0:

    print((0))

else:

    print((len(ans)))

    print((" ".join(ans)))
N = int(eval(input()))

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



r = [0] * N





def f(n):

    """

    nの倍数のボールの数

    """

    cnt = 0

    t = n + n

    while t <= N:

        cnt += r[t-1]

        t += n

    return cnt





for i in range(N):

    n = N - i

    x = f(n)

    if x % 2 == A[n-1]:

        pass

    else:

        r[n-1] += 1



# print(r)



ans = []

for i, ri in enumerate(r):

    if ri == 1:

        ans.append(str(i+1))



if len(ans) == 0:

    print((0))

else:

    print((len(ans)))

    print((" ".join(ans)))
N = int(eval(input()))
A = list(map(int, input().split()))
r = [0] * N


def f(n):
    """
    nの倍数のボールの数
    """
    cnt = 0
    i = 2
    while n * i <= N:
        cnt += r[n * i - 1]
        i += 1
    return cnt


for i in range(N):
    n = N - i
    x = f(n)
    if x % 2 == A[n - 1]:
        pass
    else:
        r[n - 1] += 1
# print(r)
ans = []
for i, ri in enumerate(r):
    if ri == 1:
        ans.append(str(i + 1))
if len(ans) == 0:
    print((0))
else:
    print((len(ans)))
    print((" ".join(ans)))

N = int(eval(input()))
A = list(map(int, input().split()))
r = [0] * N


def f(n):
    """
    nの倍数のボールの数
    """
    cnt = 0
    t = n + n
    while t <= N:
        cnt += r[t - 1]
        t += n
    return cnt


for i in range(N):
    n = N - i
    x = f(n)
    if x % 2 == A[n - 1]:
        pass
    else:
        r[n - 1] += 1
# print(r)
ans = []
for i, ri in enumerate(r):
    if ri == 1:
        ans.append(str(i + 1))
if len(ans) == 0:
    print((0))
else:
    print((len(ans)))
    print((" ".join(ans)))

-    i = 2 -    while n * i <= N: -        cnt += r[n * i - 1] -        i += 1 +    t = n + n +    while t <= N: +        cnt += r[t - 1] +        t += n