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.*;
import java.util.*;


public class Solution {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int max = (int) (1e5 + 1);
        int n = sc.nextInt();
        int[] r = sc.nextIntArray(n);
        int ans = 0;
        StringBuilder sb = new StringBuilder();
        HashMap<Integer, Integer> occ = new HashMap<>();
        for (int x : r)
            occ.put(x, occ.getOrDefault(x, 0) + 1);
        Queue<Integer> adjList[] = new LinkedList[max];
        for (int i = 1; i < max; i++)
            adjList[i] = new LinkedList<>();
        for (int x : occ.keySet())
            adjList[occ.get(x)].add(x);
        TreeSet<Integer> pq = new TreeSet<>();
        for (int i = max - 1; i > 0; i--)
            if (!adjList[i].isEmpty()) pq.add(i);
        while (!pq.isEmpty()) {
            int cur = pq.last();
            while (!adjList[cur].isEmpty()) {
                int a = adjList[cur].remove();
                if (adjList[cur].isEmpty()) pq.remove(cur);
                if (pq.isEmpty()) break;
                Integer next = pq.last();
                int b = adjList[next].remove();
                if (adjList[next].isEmpty()) pq.remove(next);
                if (pq.isEmpty()) break;
                Integer nextnext = pq.last();
                int c = adjList[nextnext].remove();
                if (adjList[nextnext].isEmpty()) pq.remove(nextnext);
                ans++;
                sb.append(putInOrder(a, b, c));
                if (cur != 1) {
                    adjList[cur - 1].add(a);
                    pq.add(cur - 1);
                }
                if (next != 1) {
                    adjList[next - 1].add(b);
                    pq.add(next - 1);
                }
                if (nextnext != 1) {
                    adjList[nextnext - 1].add(c);
                    pq.add(nextnext - 1);
                }

            }
        }
        out.println(ans);
        out.println(sb);
        out.close();
        out.flush();

    }

    static String putInOrder(int a, int b, int c) {
        int[] tmp = {a, b, c};
        Arrays.sort(tmp);
        return tmp[2] + " " + tmp[1] + " " + tmp[0] + "\n";
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream system) {
            br = new BufferedReader(new InputStreamReader(system));
        }

        public Scanner(String file) throws Exception {
            br = new BufferedReader(new FileReader(file));
        }

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public char nextChar() throws IOException {
            return next().charAt(0);
        }

        public Long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

        public void waitForInput() throws InterruptedException {
            Thread.sleep(3000);
        }

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

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


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

        public double[] nextDoubleArray(int n) throws IOException {
            double[] ans = new double[n];
            for (int i = 0; i < n; i++)
                ans[i] = nextDouble();
            return ans;
        }

        public short nextShort() throws IOException {
            return Short.parseShort(next());
        }

    }

}

