Problem: As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any three snowballs whose radii are pairwise different. For example, the balls with radii 1, 2 and 3 can be used to make a snowman but 2, 2, 3 or 2, 2, 2 cannot. Help Sergey and his twins to determine what maximum number of snowmen they can make from those snowballs.

Input

The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.

Output

Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the snowmen in any order. If there are several solutions, print any of them.

Examples

Input

7
1 2 3 4 5 6 7


Output

2
3 2 1
6 5 4


Input

3
2 2 3


Output

0

Solution (in JAVA):

Solution:
//package acc;
import java.util.*;
import java.io.*;

   public  class ACC { 
//************Main*****************//
         static int sum=0;
         static List snow[]=new ArrayList[3];
         static void fun(int x,int y,int z,int n){
             int arr1[]=new int[3];
             arr1[0]=x;arr1[1]=y;arr1[2]=z;
             Arrays.sort(arr1);
             sum+=n;
             while(n--!=0) {
                 snow[0].add(arr1[0]);
                 snow[1].add(arr1[1]);
                 snow[2].add(arr1[2]);
             }
         }
         public static void main(String[] args) throws IOException
			 {
             //   PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
              //  Scanner in=new Scanner (System.in);
               InputStream inputStream = System.in;
                OutputStream outputStream = System.out;
                InputReader in = new InputReader(inputStream);
                PrintWriter out = new PrintWriter(outputStream);
                snow[0]=new ArrayList<>();
                snow[1]=new ArrayList<>();
                snow[2]=new ArrayList<>();
                int n=in.nextInt();
                int arr[]=new int[n];
                for(int i=0;i<n;i++) arr[i]=in.nextInt();
                Arrays.sort(arr);
                PriorityQueue<Pair> p=new PriorityQueue<>();
                int x=1;
                for(int i=1;i<n;i++){
                    if(arr[i]!=arr[i-1]){
                        p.add(new Pair(-x,arr[i-1]));
                        x=1;
                }
                    else x++;
         }
                p.add(new Pair(-x,arr[n-1]));
               
                while(true){
                    if(p.size()<3) break;
                    Pair y=p.poll();
                    Pair y1=p.poll();
                    Pair y2=p.poll();
                    if(y2.x>=0) break;
                    fun(y.y,y1.y,y2.y,1);
                    
                    p.add(new Pair(y.x+1,y.y));
                    p.add(new Pair(y2.x+1,y2.y));
                    p.add(new Pair(y1.x+1,y1.y));
                }
                out.println(sum);
                for(int i=0;i<sum;i++) out.println(snow[2].get(i)+" "+snow[1].get(i)+" "+snow[0].get(i));
                out.close();
         }
         
   }
    class Pair implements Comparable<Pair>{
    int x,y;
    public  Pair(int X,int Y){
        super();
x=X;
y=Y;
}
    @Override
      public int compareTo(Pair p){
          if((x)==(p.x)) return Integer.compare((y), (p.y));
       return Integer.compare((x), (p.x));
}
  }

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong(){
        return Long.parseLong(next());
    }
}