import numpy as np





def solve(string):

    n, *a = list(map(int, string.split()))

    a = np.asarray([0] + a)

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

        a[i] = a[i::i].sum() % 2

    ans = np.where(a == 1)[0]

    return "0" if len(ans) == 0 else "{}\n{}".format(len(ans), " ".join(map(str, ans)))





if __name__ == '__main__':

    print((solve('\n'.join([eval(input()), eval(input())]))))

def solve(string):

    n, *a = list(map(int, string.split()))

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

        a[i - 1] = sum(a[i - 1::i]) % 2

    ans = [str(i + 1) for i, _a in enumerate(a) if _a == 1]

    return "0" if len(ans) == 0 else "{}\n{}".format(len(ans), " ".join(ans))





if __name__ == '__main__':

    print((solve('\n'.join([eval(input()), eval(input())]))))

import numpy as np


def solve(string):
    n, *a = list(map(int, string.split()))
    a = np.asarray([0] + a)
    for i in range(n // 2, 0, -1):
        a[i] = a[i::i].sum() % 2
    ans = np.where(a == 1)[0]
    return "0" if len(ans) == 0 else "{}\n{}".format(len(ans), " ".join(map(str, ans)))


if __name__ == "__main__":
    print((solve("\n".join([eval(input()), eval(input())]))))

def solve(string):
    n, *a = list(map(int, string.split()))
    for i in range(n // 2, 0, -1):
        a[i - 1] = sum(a[i - 1 :: i]) % 2
    ans = [str(i + 1) for i, _a in enumerate(a) if _a == 1]
    return "0" if len(ans) == 0 else "{}\n{}".format(len(ans), " ".join(ans))


if __name__ == "__main__":
    print((solve("\n".join([eval(input()), eval(input())]))))

-import numpy as np - - -    a = np.asarray([0] + a) -        a[i] = a[i::i].sum() % 2 -    ans = np.where(a == 1)[0] -    return "0" if len(ans) == 0 else "{}\n{}".format(len(ans), " ".join(map(str, ans))) +        a[i - 1] = sum(a[i - 1 :: i]) % 2 +    ans = [str(i + 1) for i, _a in enumerate(a) if _a == 1] +    return "0" if len(ans) == 0 else "{}\n{}".format(len(ans), " ".join(ans))