1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <bits/stdc++.h>

using namespace std;

int main() {    
    int n;
    scanf("%d", &n);
    int good = 0;
    for (int i = 1; i <= n; i++) {
        int deg;
        scanf("%d", &deg);
        if (deg == 1) {
            good++;
        }
    }
    
    int ans = max(0, 2 - good);
    
    printf("%d\n2\n%d %d\n", ans, 1, 2); 
    
    return 0;
}