C. One, Two, Three
time limit per test
2 seconds
memory limit per test
1024 mebibytes
input
standard input
output
standard output

You are given a sequence of length $$$N$$$: $$$A_0, A_1, \ldots, A_{N-1}$$$. It consists of only three kinds of integers: $$$1, 2, 3$$$.

A tuple of indices $$$(i, j, k)$$$ is $$$\textit{good}$$$ if $$$0 \le i \lt j \lt k \lt N$$$ and it satisfies one of the two following conditions: either $$$A_i = 1, \, A_j = 2, \, A_k = 3$$$ or $$$A_i = 3, \, A_j = 2, \, A_k = 1$$$.

Your goal is find disjoint good tuples, as many of them as possible. A group of tuples is disjoint if no index is present in more than one tuple.

Find the maximum number of disjoint good tuples and print each tuple.

Input

The first line contains an integer $$$N$$$, the length of the given sequence ($$$1 \le N \le 600\,000$$$).

The next line contains $$$N$$$ integers: $$$A_0, A_1, \ldots, A_{N-1}$$$ ($$$1 \le A_i \le 3$$$).

Output

On the first line, print an integer $$$M$$$, the maximum number of disjoint good tuples.

On the next $$$M$$$ lines, print the tuples themselves. Each of these lines must contains three integers $$$i, j, k$$$ ($$$0 \le i \lt j \lt k \lt N$$$) that describes a good tuple. All the printed tuples must be disjoint. If there are several solutions, print any one of them.

Examples
Input
6
3 1 2 2 3 1
Output
2
1 2 4
0 3 5
Input
6
2 1 3 1 3 2
Output
0