#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define OUT(a) cout << (a) << "\n"
#define ll long long
#define uint unsigned int
#define ushort unsigned short
#define ulong unsigned long

ll MOD = 10e9 + 7;

int main() {
    int n;
    cin >> n;
    vector<int> a(n+1);
    vector<int> res;
    bool isok = true;
    for(int i=1; i<n+1; i++) cin >> a[i];
    for(int i=n; i>=1; i--) {
        int su = 0;
        for(int j=i; j<n+1; j+=i) su += a[j];
        //printf("%d : %d\n", i, su);
        su %= 2;
        if (su != a[i]) isok = false;
        else if (a[i] == 1) res.push_back(i);
    }
    if (isok) {
        n = res.size();
        printf("%d\n", n);
        for(int i=0; i<n; i++) printf("%d ", res[i]);
        printf("\n");
    } else {
        printf("-1\n");
    }
    return 0;
}

