1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
using namespace std;

int t[1000001];
int main() {
    int n;
    cin>>n;
    for(int i =0;i<n;i++)cin>>t[i];
    int w = 0;
    for(int i =0;i<n;i++)
        if(t[i]==1)w++;
    if(w>=2){
        cout<<0<<"\n";
        cout<<2<<"\n";
        cout<<1<<" "<<2<<"\n";
    }else if(w==1){
        cout<<1<<"\n";
        cout<<2<<"\n";
        cout<<1<<" "<<2<<"\n";
    }
    else if(w==0){
        cout<<2<<"\n";
        cout<<2<<"\n";
        cout<<1<<" "<<2<<"\n";
    }

    return 0;
}