/*IN FISH AT EGOI I TRUST*/
/*IN FISH AT EGOI I TRUST*/
/*IN FISH AT EGOI I TRUST*/
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppl;
typedef long double ld;

mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,popcnt")

ll n,c,a[1000009],b[1000009];
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++) {
            cin>>a[i];
            if(a[i]) {c++;
            b[c]=i;}
    }
    cout<<((c%3)!=0)<<"\n"<<b[1]<<" "<<b[1+c/3]<<" "<<b[1+c/3+(c+2)/3]<<endl;

    return 0;
}
