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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.HashMap;
import java.io.InputStreamReader;
import java.util.AbstractCollection;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        SnowMen solver = new SnowMen();
        solver.solve(1, in, out);
        out.close();
    }

    static class SnowMen {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            PriorityQueue<IntPair> pq = new PriorityQueue<>(new Comparator<IntPair>() {

                public int compare(IntPair a, IntPair b) {
                    if (a.getSecond() == b.getSecond()) {
                        return Integer.compare(b.getFirst(), a.getFirst());
                    }
                    return Integer.compare(b.getSecond(), a.getSecond());
                }
            });
            HashMap<Integer, Integer> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                int cur = in.nextInt();
                map.put(cur, map.getOrDefault(cur, 0) + 1);
            }
            for (int i : map.keySet()) {
                pq.add(new IntPair(i, map.get(i)));
            }
            if (pq.size() < 3) {
                out.println(0);
                return;
            }
            StringBuilder ans = new StringBuilder();
            int number = 0;
            while (!pq.isEmpty()) {
                IntPair first = pq.poll();
                IntPair second = pq.poll();
                IntPair third = pq.poll();
                ans.append(getOrder(first.getFirst(), second.getFirst(), third.getFirst()) + "\n");
                ++number;
                first.setSecond(first.getSecond() - 1);
                if (first.getSecond() > 0) pq.add(first);

                third.setSecond(third.getSecond() - 1);
                if (third.getSecond() > 0) pq.add(third);

                second.setSecond(second.getSecond() - 1);
                if (second.getSecond() > 0) pq.add(second);
                if (pq.size() < 3) break;
            }
            out.println(number);
            out.println(ans.toString().trim());
        }

        String getOrder(int a, int b, int c) {
            int[] ans = new int[]{a, b, c};
            Arrays.sort(ans);
            return ans[2] + " " + ans[1] + " " + ans[0];
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

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

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

    }

    static class IntPair implements Comparable<IntPair> {
        int first;
        int second;

        public IntPair(int first, int second) {
            this.first = first;
            this.second = second;
        }


        public int compareTo(IntPair a) {
            if (second == a.second) {
                return Integer.compare(first, a.first);
            }
            return Integer.compare(second, a.second);
        }


        public String toString() {
            return "<" + first + ", " + second + ">";
        }


        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            IntPair a = (IntPair) o;

            if (first != a.first) return false;
            return second == a.second;
        }


        public int hashCode() {
            int result = first;
            result = 31 * result + second;
            return result;
        }

        public int getFirst() {
            return first;
        }

        public int getSecond() {
            return second;
        }

        public void setSecond(int second) {
            this.second = second;
        }

    }
}

