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

int main()
{
    long long int N, i, div, result;
    cin >> N;
    vector<long long int> A_sum(N);
    vector<long long int> A(N);
    div = 1;
    for (i = 0; i < 9; i++)
    {
        div *= 10;
    }
    div += 7;
    for (i = 0; i < N; i++)
    {
        cin >> A[i];
        A[i] = A[i] % div;
    }
    A_sum[N - 1] = A[N - 1];
    for (i = N - 2; i > 0; i--)
    {
        A_sum[i] = A_sum[i + 1] + A[i];
        A_sum[i] = A_sum[i] % div;
    }
    result = 0;
    for (i = 0; i < N - 1; i++)
    {
        result += A[i] * A_sum[i + 1];
        result = result % div;
    }
    cout << result << endl;
    return 0;
}
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define F first
#define S second

using namespace std;
using P = pair<int,int>;
using ivec = vector<int>;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }


const int MOD=1000000007;
int INF=100100100100100;
int a[200010];
int ans[200010];
signed main(){
  int n;cin>>n;
  int cnt=0;
  for(int i=1;i<=n;i++){
    cin>>a[i];
  }
  for(int i=n;i>=1;i--){
    int sum=0;
    for(int j=2*i;j<=n;j+=i){
      sum+=ans[j];
    }
    ans[i]=(sum+a[i])%2;
    if(ans[i])cnt++;
  }
  cout<<cnt<<endl;
  for(int i=1;i<=n;i++){
    if(ans[i])cout<<i<<endl;
  }
  return 0;
}
