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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef long long ll;

vector<int> ball(200005,0);

void putball(int n){
  for(int i=1; i<=sqrt(n); i++){
    if(n%i==0){
      ball.at(i)++;
      if(i!=n/i)ball.at(n/i)++;
      //cout << "putball " << i << endl;
    }
  }
}

int main(){
  int n;
  cin >> n;

  vector<int> a(n);
  rep(i,n) cin >> a.at(i);

  int ballcount = 0;
  vector<int> b;

  rep(i,n){
    int j = n-i;
    if((ball.at(j)%2)!=a.at(j-1)){
      putball(j);
      b.push_back(j);
      ballcount++;
      //cout << "putball " << j << endl;
    }
  }

  if((ball.at(1)%2)==a.at(0)){
    cout << ballcount << endl;
    rep(i,b.size()) cout << b.at(i) << " ";
  }else{
    cout << "-1";
  }
  
  //cout << "hoge";
  //rep(i,n) cout << ball.at(i+1) << " ";
}
#include<bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i = 0; i < n; i++)
#define Rep(i,n) for(int i = 1; i <= n; i++)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
template<class T> using V = vector<T>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



int main(){
    int n;
    cin >> n;
    V<int> a(n);
    rep(i,n) cin >> a[i];
    int tot = 0;
    rep(i,n) tot += a[i];
    V<P> v(n);
    rep(i,n) {
        v[i] = make_pair(abs(tot-a[i]*n), i);
    }
    sort(all(v));
    cout << v[0].se << endl;
}
