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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.util.Vector;

/**
 * Created by IntelliJ IDEA.
 * User: ivanovak
 * Date: 1/6/12
 * Time: 4:19 PM
 */
public class PriorityQueue implements Runnable {
    static private BufferedReader br = null;
    static private PrintWriter pw = null;
    static private StringTokenizer st = null;

    class Pair {
        int a, b; // a - value, b - priority

        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        int getA() {
            return a;
        }
        int getB() {
            return b;
        }
        void setA(int a) {
            this.a = a;
        }
        void setB(int b) {
            this.b = b;
        }
        public String toString() {
            return this.a + " " + this.b + "\n";
        }
    }

    class Triple {
        int a, b, c;

        public Triple(int a, int b, int c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

        public String toString() {
            return this.a + " " + this.b + " " + this.c;
        }
    }
//
//    public void swapPairs(Pair a, Pair b) {
//        Pair t = new Pair(a.getA(), a.getB());
//        a.setA(b.getA());
//        a.setB(b.getB());
//        b.setA(t.getA());
//        b.setB(t.getB());
//    }

    public void solve() throws IOException {
        java.util.PriorityQueue<Pair> queue = new java.util.PriorityQueue<Pair>(255, new Comparator<Pair>() {
            public int compare(Pair x, Pair y) {
                if(x.b < y.b) {
                    return 1;
                }
                if(x.b > y.b) {
                    return -1;
                }
                return 0;
            }
        });
        int n = nextInt();
        Vector<Integer> arr = new Vector<Integer>();
        for(int i = 0 ; i < n ; ++i) {
            arr.add(nextInt());
        }
        Collections.sort(arr, new Comparator<Integer>() {
            public int compare(Integer o1, Integer o2) {
                if(o1 > o2) {
                    return 1;
                }
                if(o1 < o2) {
                    return -1;
                }
                return 0;
            }
        });
        int iter = 0;
        while(iter < n) {
            int curr = arr.get(iter);
            int i = 1;
            while(iter+i<n && arr.get(iter+i) == curr) {
                ++i;
            }
            iter += i;
            queue.add(new Pair(curr, i));
        }
        if(queue.size() <= 2) {
            pw.print("0");

        } else {
            Vector<Triple> tr = new Vector<Triple>();
            while(queue.size() > 2) {
                Pair a = queue.poll();
                Pair b = queue.poll();
                Pair c = queue.poll();
                int a1, b1, c1;
                a1 = a.getA();
                b1 = b.getA();
                c1 = c.getA();
                int t;
                if(a1 < b1) {
                    t = a1;
                    a1 = b1;
                    b1 = t;
                }
                if(a1 < c1) {
                    t = a1;
                    a1 = c1;
                    c1 = t;
                }
                if(b1 < c1) {
                    t = b1;
                    b1 = c1;
                    c1 = t;
                }
                a.setB(a.getB()-1);
                b.setB(b.getB()-1);
                c.setB(c.getB()-1);
                tr.add(new Triple(a1, b1, c1));
                if(a.getB() != 0) {
                    queue.add(a);
                }
                if(b.getB() != 0) {
                    queue.add(b);
                }
                if(c.getB() != 0) {
                    queue.add(c);
                }
            }
            System.out.println(tr.size());
            for(Triple t : tr) {
                System.out.println(t.toString());
            }
        }

    }

    public void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            pw = new PrintWriter(System.out);
            solve();
            pw.close();
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        new PriorityQueue().run();
    }

    static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null)
                return null;
            st = new StringTokenizer(s);
        }

        return st.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    static String nextStr() throws IOException {
        return nextToken();
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}
