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

void solve() {
    int n;
    cin >> n;
    vector<int> v(n);
    int s = 0;
    for(int i=0; i<n; i++) {
        cin >> v[i];
        if(v[i]==1) s++;
    }
    if(s%3==0) cout << 0;
    else cout << 1;
    cout << endl;
    int h = s/3, k = 0, g = 0;
    for(int i=0; i<n; i++) {
        k+=v[i];
        if(k>h && g<3) {
            cout << i << " ";
        }
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    //cin >> t;
    while(t--) {
        solve();
    }
}
