#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
	ll n; cin >> n;
  	auto a = vector<ll>(n+1,0);
    auto h = vector<ll>(n+1,0);  
  	auto b = vector<ll>();
  	for(ll i=1;i<=n;i++){
      cin >> a[i];
    }
  	
  	for(ll i=n;i>=1;i--){
      	bool sum = false;
    	for(ll j=i;j<=n;j+=i) sum^=h[j];
        h[i]=sum^a[i];
      	if(h[i]) b.push_back(i);
    }
  	
  	cout << b.size() << endl;
  	for(auto i:b) cout << i << " ";
  	
  
}