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.io.BufferedInputStream;
import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.TreeSet;

public class NewYearSnowmen { //Round #100 - New Year Snowmen
	public static void main(String[] args) {
		Scanner sc = new Scanner(new BufferedInputStream(System.in));
		
		int numSnowBalls = sc.nextInt();
		TreeMap<Integer, Count> lookupBySize = new TreeMap<Integer, Count>();
		for(int i = 0; i < numSnowBalls; i++) {
			int radii = sc.nextInt();
			if(lookupBySize.containsKey(radii)) {
				lookupBySize.get(radii).count++;
			} else {
				Count newCountObj = new Count(radii, 1);
				lookupBySize.put(radii, newCountObj);
			}
		}
		
		TreeSet<Count> counts = new TreeSet<Count>();
		for(Count count : lookupBySize.values()) {
			counts.add(count);
		}
		
		int snowmenCount = 0;
		StringBuilder output = new StringBuilder();
		
		while(counts.size() >= 3) {
			Count[] nextSnowBalls = new Count[3];
			for(int i = 0; i < 3; i++) {
				nextSnowBalls[i] = counts.first();
				counts.remove(nextSnowBalls[i]);
			}
			
			for(int i = 0; i < 3; i++) {
				nextSnowBalls[i].count--;
				if(nextSnowBalls[i].count > 0) {
					counts.add(nextSnowBalls[i]);
				}
			}
			
			int[] sizes = new int[3];
			for(int i = 0; i < sizes.length; i++) {
				sizes[i] = nextSnowBalls[i].snowBallSize;
			}
			
			Arrays.sort(sizes);
			
			output.append(sizes[2] + " " + sizes[1] + " " + sizes[0] + "\n");
			snowmenCount++;
		}
		
		System.out.println(snowmenCount);
		if(snowmenCount > 0) {
			System.out.println(output.substring(0, output.length()-1));
		}
	}
}

class Count implements Comparable<Count> {
	public int snowBallSize, count;

	public Count(int snowBallSize, int count) {
		this.snowBallSize = snowBallSize;
		this.count = count;
	}

	public int compareTo(Count other) {
		if(count > other.count) {
			return -1;
		} else if(count == other.count) {
			if(snowBallSize > other.snowBallSize) {
				return -1;
			} else if(snowBallSize == other.snowBallSize) {
				return 0;
			} else {
				return 1;
			}
		} else {
			return 1;
		}
	}

	@Override
	public String toString() {
		return "Count{" + "snowBallSize=" + snowBallSize + ", count=" + count + '}';
	}
}