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:


import java.awt.*;
import java.io.*;
import java.util.*;

public class NewYearSnowMen140C {
    public static void main(String[] args) {
        try {
            BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));

            String[] vals = buffer.readLine().split(" ");

            int num = Integer.parseInt(vals[0]);

            vals = buffer.readLine().split(" ");

            int[] a = new int[num];
            for (int i = 0; i < num; i++) {
                a[i] = Integer.parseInt(vals[i]);
            }

            Arrays.parallelSort(a);
            TreeSet<ball> ts = new TreeSet<>();

            for (int i = 0; i < num; i++) {
                int save = a[i];
                int c = 1;
                while (i < num -1 && save == a[i + 1]) {
                    i++;
                    c++;
                }
                ts.add(new ball(save, c));
            }

            ArrayList<Integer> re = new ArrayList<>();
            int[] temp = new int[3];
            while (ts.size() > 2) {
                ball b1 = ts.pollLast();
                ball b2 = ts.pollLast();
                ball b3 = ts.pollLast();

                if (b1.b > 0 && b2.b > 0 && b3.b > 0) {
                    temp[0] = b1.a;
                    temp[1] = b2.a;
                    temp[2] = b3.a;

                    Arrays.sort(temp);

                    re.add(temp[2]);
                    re.add(temp[1]);
                    re.add(temp[0]);
                } else
                    break;
                ts.add(new ball(b1.a, b1.b - 1));
                ts.add(new ball(b2.a, b2.b - 1));
                ts.add(new ball(b3.a, b3.b - 1));
            }

            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
            out.write(re.size() / 3+ " ");
            out.newLine();
            for (int i = 0; i < re.size(); i++) {
                if (i != 0 && i % 3 == 0) {
                    out.newLine();
                }
                out.write(re.get(i) + " ");
            }
            out.flush();
            out.close();

            buffer.close();
        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
    }

    public static class ball implements Comparable<ball> {
        int a;
        int b;

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

        @Override
        public int compareTo(ball ball) {
            if (this.b == ball.b) {
                return this.a - ball.a;
            }
            return this.b - ball.b;
        }
    }
}