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.util.StringTokenizer;
import java.util.Collections;
import java.util.Collection;
import java.util.Set;
import java.util.HashSet;
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Queue;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Stack;
import java.util.Vector;
import java.util.Hashtable;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileReader;

import java.math.BigInteger;

public class Main
{
	static PrintWriter writer;
	static StringTokenizer sz;
	static BufferedReader reader;

	public static void main(String[] args)
	throws Exception
	{
		declare();

		int n = Integer.parseInt(reader.readLine());
		ht = new Hashtable<Integer,Integer>();
		int v;
		count = 0;
		keys = new ArrayList<Integer>();

		readLine();
		for (int i=1;i <= n;++i)
		{
			v = readInt();

			if (ht.containsKey(v))
			{
				ht.put(v,  ht.get(v) + 1);
			}
			else
			{
				ht.put(v, 1);
				keys.add(v);
				++count;
			}
		}

		sb = new StringBuilder();
		ans = 0;

		pq = new PriorityQueue<Val>();

		for (int i=0;i < count;++i)
			pq.add(new Val(v = keys.get(i), ht.get(v)));

		while (count > 2)
			test();

		writer.println(ans);
		writer.println(sb);

		close();
	}

	static class Val implements Comparable<Val>
	{
		int val,freq;

		public Val(int v, int f)
		{
			val = v;
			freq = f;
		}

		@Override
		public int compareTo(Main.Val o)
		{

			if (freq != o.freq)
				return o.freq - freq;
			return o.val - val;

		}
	}

	static StringBuilder sb;
	static int count,ans;
	static ArrayList<Integer> keys;
	static Hashtable<Integer,Integer> ht;
	static PriorityQueue<Val> pq;

	private static void test()
	{
		ArrayList<Integer> line = new ArrayList<Integer>();
		ArrayList<Val> temp = new ArrayList<Val>();

		int v,freq;
		Val obj;

		for (int i=0;i < 3;++i)
		{
			obj = pq.poll();
			v = obj.val;
			freq = obj.freq;

			line.add(v);

			if (freq == 1)
				--count;
			else
				temp.add(new Val(v, freq - 1));
		}

		Collections.sort(line);
		++ans;

		for (int i=2;i > -1;--i)
			sb.append(line.get(i) + " ");

		for (Val el:temp)
			pq.add(el);

		sb.append("\n");

	}

	private static String readString()
	throws IOException
	{
		return reader.readLine();
	}

	private static void readLine()
	throws IOException
	{
		sz = new StringTokenizer(reader.readLine());
	}

	private static int readInt()
	throws IOException
	{
		return Integer.parseInt(sz.nextToken());
	}

	private static long readLong()
	throws IOException
	{
		return Long.parseLong(sz.nextToken());
	}

	private static void declare()
	{
		writer = new PrintWriter(System.out);
		reader = new BufferedReader(
			new InputStreamReader(System.in));
	}

	private static void declareFile()
	throws IOException
	{
		writer = new PrintWriter("output.txt");
		reader = new BufferedReader(
			new FileReader("input.txt"));
	}

	private static void close()
	throws IOException
	{
		writer.flush();
		writer.close();
		reader.close();
	}
}