#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main(void) {
  int n;
  cin >> n;
  int piv = 0;
  int ball_num = 0;
  int j;
  vector<int> a(n);
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    a[i] = b;
  }
  for (int i = n; i > 0; i--) {
    j = i;
    int count = 2;
    int sum = 0;
    if (j * 2 <= n) {
      while (j * count <= n) {
        sum += ans[j * count - 1];
        count++;
      }
    }
    if (sum == a[j - 1]) {
      ans[j - 1] = 0;
    } else {
      ans[j - 1] = 1;
      ball_num++;
      if (ans[j - 1] != a[j - 1]) {
        cout << "-1";
        piv = 1;
        break;
      }
    }
  }
  if (piv == 0) {
    cout << ball_num << endl;
    for (int i = 0; i < n; i++) {
      if (ans[i] == 1) cout << i + 1 << " ";
    }
  }
  if (ball_num != 0) cout << endl;
  return 0;
}
