#include<iostream>
#include<sstream>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;++i)
		cin>>a[i];
	int b[n];
	for(int i=n-1;i>-1;--i){
		b[i]=a[i];
		if((i+1)*2-1>=n)
			continue;
		for(int j=(i+1)*2-1;j<n;j+=(i+1))
			b[i]^=b[j];
	}
	stringstream sout;
	int tot=0;
	for(int i=0;i<n;++i)
		if(b[i]){
			++tot;
			sout<<i+1<<' ';
		}
	cout<<tot<<endl;
	while(sout>>tot)
		cout<<tot<<' ';
	return 0;
}