def main():

    import sys

    input = sys.stdin.readline

    sys.setrecursionlimit(10**7)

    from collections import Counter, deque

    #from collections import defaultdict

    from itertools import combinations, permutations, accumulate, groupby

    #from itertools import product

    from bisect import bisect_left,bisect_right

    import heapq

    from math import floor, ceil

    #from operator import itemgetter



    #inf = 10**17

    #mod = 10**9 + 7



    n = int(eval(input()))

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

    res = []

    #dp[i]:i番目の箱に入ってるかどうか

    dp = [0]*n



    #iの倍数の箱を調べる

    for i in range(n, 0, -1):

        #調べる箱列挙

        t = 0

        for j in range(i, n+1, i):

            t += dp[j-1]

        if t%2 != a[i-1]:

            res.append(i)

            dp[i-1] = 1



    if not 1 in a:

        print((0))

    else:

        if len(res)>0:

            print((len(res)))

            print((*res))

        else:

            print((-1))



if __name__ == '__main__':

    main()

def main():

    import sys

    input = sys.stdin.readline

    sys.setrecursionlimit(10**7)

    from collections import Counter, deque

    #from collections import defaultdict

    from itertools import combinations, permutations, accumulate, groupby

    #from itertools import product

    from bisect import bisect_left,bisect_right

    import heapq

    from math import floor, ceil

    #from operator import itemgetter



    #inf = 10**17

    #mod = 10**9 + 7



    n = int(eval(input()))

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

    res = []

    #dp[i]:i番目の箱に入ってるかどうか

    dp = [0]*n



    #iの倍数の箱を調べる

    for i in range(n, 0, -1):

        #調べる箱列挙

        t = 0

        for j in range(i, n+1, i):

            t += dp[j-1]

        if t%2 != a[i-1]:

            res.append(i)

            dp[i-1] = 1



    if not 1 in a:

        print((0))

    else:

        print((len(res)))

        print((*res))



if __name__ == '__main__':

    main()

def main():
    import sys

    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque

    # from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby

    # from itertools import product
    from bisect import bisect_left, bisect_right
    import heapq
    from math import floor, ceil

    # from operator import itemgetter
    # inf = 10**17
    # mod = 10**9 + 7
    n = int(eval(input()))
    a = list(map(int, input().split()))
    res = []
    # dp[i]:i番目の箱に入ってるかどうか
    dp = [0] * n
    # iの倍数の箱を調べる
    for i in range(n, 0, -1):
        # 調べる箱列挙
        t = 0
        for j in range(i, n + 1, i):
            t += dp[j - 1]
        if t % 2 != a[i - 1]:
            res.append(i)
            dp[i - 1] = 1
    if not 1 in a:
        print((0))
    else:
        if len(res) > 0:
            print((len(res)))
            print((*res))
        else:
            print((-1))


if __name__ == "__main__":
    main()

def main():
    import sys

    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque

    # from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby

    # from itertools import product
    from bisect import bisect_left, bisect_right
    import heapq
    from math import floor, ceil

    # from operator import itemgetter
    # inf = 10**17
    # mod = 10**9 + 7
    n = int(eval(input()))
    a = list(map(int, input().split()))
    res = []
    # dp[i]:i番目の箱に入ってるかどうか
    dp = [0] * n
    # iの倍数の箱を調べる
    for i in range(n, 0, -1):
        # 調べる箱列挙
        t = 0
        for j in range(i, n + 1, i):
            t += dp[j - 1]
        if t % 2 != a[i - 1]:
            res.append(i)
            dp[i - 1] = 1
    if not 1 in a:
        print((0))
    else:
        print((len(res)))
        print((*res))


if __name__ == "__main__":
    main()

-        if len(res) > 0: -            print((len(res))) -            print((*res)) -        else: -            print((-1)) +        print((len(res))) +        print((*res))