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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;

const int INF = 1000000009;
const LL LINF = 1000000000000000009LL;

#define FOR(i, b, e) for(int i = b; i <= e; ++i) 
#define FORD(i, b, e) for(int i = b; i >= e; --i) 
#define REP(i, n) FOR(i, 0, n-1)
#define REV(i, n) FORD(i, n-1, 0)
#define PB push_back
#define PP pop_back
#define MP make_pair
#define ST first
#define ND second
#define SIZE(c) (int)(c).size()
#define ALL(c) (c).begin(), (c).end()

#define DEBUG(s) s

const int N = 1000005;

int n, a, ones, x;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin>>n;
	
	FOR(i, 1, n)
	{
		cin>>a;
		if(a == 1) ones++;
	}
	
	x = max(0, 2-ones);
	
	cout<<x<<"\n2\n1 2\n";
	
	return 0;
}