The School №0 of the capital of Berland has n children studying in it. All the children in this school are gifted: some of them are good at programming, some are good at maths, others are good at PE (Physical Education). Hence, for each child we know value ti:

  * ti = 1, if the i-th child is good at programming, 
  * ti = 2, if the i-th child is good at maths, 
  * ti = 3, if the i-th child is good at PE 



Each child happens to be good at exactly one of these three subjects.

The Team Scientific Decathlon Olympias requires teams of three students. The school teachers decided that the teams will be composed of three children that are good at different subjects. That is, each team must have one mathematician, one programmer and one sportsman. Of course, each child can be a member of no more than one team.

What is the maximum number of teams that the school will be able to present at the Olympiad? How should the teams be formed for that?

Input

The first line contains integer n (1 ≤ n ≤ 5000) — the number of children in the school. The second line contains n integers t1, t2, ..., tn (1 ≤ ti ≤ 3), where ti describes the skill of the i-th child.

Output

In the first line output integer w — the largest possible number of teams. 

Then print w lines, containing three numbers in each line. Each triple represents the indexes of the children forming the team. You can print both the teams, and the numbers in the triplets in any order. The children are numbered from 1 to n in the order of their appearance in the input. Each child must participate in no more than one team. If there are several solutions, print any of them.

If no teams can be compiled, print the only line with value w equal to 0.

Examples

Input

7
1 3 1 3 2 1 2


Output

2
3 5 2
6 7 4


Input

4
2 1 1 2


Output

0
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class B implements Runnable {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    public static void main(String[] args) {
        new Thread(null, new B(), "", 128 * (1L << 20)).start();

    }

    void init() throws FileNotFoundException {
        Locale.setDefault(Locale.US);

        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();

            init();
            solve();

            out.close();
            time();
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }


    String readString() throws IOException {

        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    String readString(String s) throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine(), s + "\n \t");
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }
    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    int readInt(String s) throws IOException {
        return Integer.parseInt(readString(s));
    }
    boolean isPrime(int a) throws IOException {
        int del=0;
        if(a==2){
            return false;
        }
        for(int i=2;i<Math.sqrt(a)+1;i++){
            if(a%i==0){
                del=i;
                break;
            }
        }
        if(del>0){
            return false;
        }
        else return true;
    }


    public BigInteger bigFactorial(int num) throws IOException {
        BigInteger fact = new BigInteger("1");
        BigInteger i = new BigInteger("1");
        BigInteger one = new BigInteger("1");
        for (int j=0;j<num;j++) {
            fact = fact.multiply(i);
            i=i.add(one);
//out.println(fact.toString()+" "+i.toString());
        }
//fact = fact.add(one);

        return fact;
    }

    public long factorial(int num) throws IOException{
        long res=1;
        for(int i=2;i<=num;i++){
            res*=i;
        }
        return res;
    }

    public int[] readIntArr(int n) throws IOException{
        int[] a = new int[n];
        for(int i=0;i<n;i++){
            a[i] = readInt();
        }
        return a;
    }

    public double formatDouble(double d, int dz)
    {
        double dd=Math.pow(10,dz);
        return Math.round(d*dd)/dd;
    }

    public class Pair implements Comparable{
        int a1;
        int a2;

        public int getA1() {
            return a1;
        }

        public int getA2() {
            return a2;
        }

        public void setA1(int a1) {
            this.a1 = a1;
        }

        public void setA2(int a2) {
            this.a2 = a2;
        }

        @Override
        public int compareTo(Object a) {
            Pair b=(Pair) a;
            if(this.a1>((Pair) a).a1){
                return -1;
            }
            if(this.a1==((Pair) a).a1)
                return 0;
            return 1;
        }
    }

    public class Triple implements Comparable{
        int a1;
        int a2;
        int a3;

        public int getA1() {
            return a1;
        }

        public void setA1(int a1) {
            this.a1 = a1;
        }

        public int getA2() {
            return a2;
        }

        public void setA2(int a2) {
            this.a2 = a2;
        }

        public int getA3() {
            return a3;
        }

        public void setA3(int a3) {
            this.a3 = a3;
        }
        @Override
        public int compareTo(Object a) {
            Triple b=(Triple) a;
            if(this.a1>((Triple) a).a1){
                return -1;
            }
            if(this.a1==((Triple) a).a1)
                return 0;
            return 1;
        }
    }

    void solve() throws IOException{

        int n=readInt();

        ArrayList<Integer> t1=new ArrayList<Integer>();
        ArrayList<Integer> t2=new ArrayList<Integer>();
        ArrayList<Integer> t3=new ArrayList<Integer>();
        for(int i=0;i<n;i++){
            int a=readInt();
            if(a==1)
                t1.add(i+1);
            if(a==2)
                t2.add(i+1);
            if(a==3)
                t3.add(i+1);
        }
        out.println(Math.min(Math.min(t1.size(), t2.size()), t3.size()));
        for(int i=0;i<Math.min(Math.min(t1.size(), t2.size()), t3.size());i++){
            out.println(t1.get(i)+" "+t2.get(i)+ " "+t3.get(i));
        }

    }


    public long fn() throws IOException{
        return 0;
    }
}