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

int main(){
	int n;
	cin >> n;
	vector<int> v(n+1),sol,vu(n+1);
	for (int i=1; i<=n; ++i){
		cin >> v[i];
	}
	for (int i=n; i>=1; --i){
		int j=2*i;
      vu[i] = v[i];
		while (j <= n){
			vu[i] += vu[j];
			j += i;
			vu[i] %= 2;
		}
		if (vu[i] == 1) sol.emplace_back(i);
	}
	cout << sol.size() << '\n';
	for (int i:sol) cout << i << ' ';
}
