n = int(eval(input()))

a_array = [int(x) for x in input().split()]

ans_array = [0 for x in range(n)]

for index in reversed(list(range(1, n + 1))):

    if index > n // 2:

        ans_array[index - 1] = a_array[index - 1]

    elif index - 1 != 0:

        tmp = sum([ans_array[x] for x in range(index * 2 - 1, n, index) if ans_array[x] != 0]) % 2

        if tmp == a_array[index - 1]:

            pass

        else:

            ans_array[index - 1] = 1



    else:

        tmp = sum([x for x in ans_array[1:] if x != 0]) % 2

        if tmp == a_array[index - 1]:

            pass

        else:

            # tmpが0だったら1、1だったら0になるように

            ans_array[index - 1] = 1

print((sum([x for x in ans_array if x != 0])))

for index, ans in enumerate(ans_array, 1):

    if ans != 0:

        print(index)

n = int(eval(input()))

array = [int(x) for x in input().split()]

ans = [0 for x in range(n)]

res = []

count = 0

for i in reversed(list(range(n))):

    a = array[i]

    if a == 1 and sum([x for x in ans[i::i+1]]) % 2 == 0:

        ans[i] = 1

        count += 1

        res.append(str(i+1))

    elif a == 0 and sum([x for x in ans[i::i+1]]) % 2 == 1:

        ans[i] = 1

        count += 1

        res.append(str(i+1))

print(count)

print((" ".join(res)))





n = int(eval(input()))
a_array = [int(x) for x in input().split()]
ans_array = [0 for x in range(n)]
for index in reversed(list(range(1, n + 1))):
    if index > n // 2:
        ans_array[index - 1] = a_array[index - 1]
    elif index - 1 != 0:
        tmp = (
            sum(
                [
                    ans_array[x]
                    for x in range(index * 2 - 1, n, index)
                    if ans_array[x] != 0
                ]
            )
            % 2
        )
        if tmp == a_array[index - 1]:
            pass
        else:
            ans_array[index - 1] = 1
    else:
        tmp = sum([x for x in ans_array[1:] if x != 0]) % 2
        if tmp == a_array[index - 1]:
            pass
        else:
            # tmpが0だったら1、1だったら0になるように
            ans_array[index - 1] = 1
print((sum([x for x in ans_array if x != 0])))
for index, ans in enumerate(ans_array, 1):
    if ans != 0:
        print(index)

n = int(eval(input()))
array = [int(x) for x in input().split()]
ans = [0 for x in range(n)]
res = []
count = 0
for i in reversed(list(range(n))):
    a = array[i]
    if a == 1 and sum([x for x in ans[i :: i + 1]]) % 2 == 0:
        ans[i] = 1
        count += 1
        res.append(str(i + 1))
    elif a == 0 and sum([x for x in ans[i :: i + 1]]) % 2 == 1:
        ans[i] = 1
        count += 1
        res.append(str(i + 1))
print(count)
print((" ".join(res)))

-a_array = [int(x) for x in input().split()] -ans_array = [0 for x in range(n)] -for index in reversed(list(range(1, n + 1))): -    if index > n // 2: -        ans_array[index - 1] = a_array[index - 1] -    elif index - 1 != 0: -        tmp = ( -            sum( -                [ -                    ans_array[x] -                    for x in range(index * 2 - 1, n, index) -                    if ans_array[x] != 0 -                ] -            ) -            % 2 -        ) -        if tmp == a_array[index - 1]: -            pass -        else: -            ans_array[index - 1] = 1 -    else: -        tmp = sum([x for x in ans_array[1:] if x != 0]) % 2 -        if tmp == a_array[index - 1]: -            pass -        else: -            # tmpが0だったら1、1だったら0になるように -            ans_array[index - 1] = 1 -print((sum([x for x in ans_array if x != 0]))) -for index, ans in enumerate(ans_array, 1): -    if ans != 0: -        print(index) +array = [int(x) for x in input().split()] +ans = [0 for x in range(n)] +res = [] +count = 0 +for i in reversed(list(range(n))): +    a = array[i] +    if a == 1 and sum([x for x in ans[i :: i + 1]]) % 2 == 0: +        ans[i] = 1 +        count += 1 +        res.append(str(i + 1)) +    elif a == 0 and sum([x for x in ans[i :: i + 1]]) % 2 == 1: +        ans[i] = 1 +        count += 1 +        res.append(str(i + 1)) +print(count) +print((" ".join(res)))