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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.StringTokenizer;

public class CFD {
	private static void sport(int[] a) {
		Map<Integer, Integer> map = new HashMap<>();
		for (int i : a) {
			map.put(i, map.getOrDefault(i, 0) + 1);
		}
		Queue<A> pq = new PriorityQueue<>(new Comparator<A>() {
			@Override
			public int compare(A o1, A o2) {
				return o2.cnt - o1.cnt;
			}
		});
		for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
			pq.add(new A(entry.getKey(), entry.getValue()));
		}
		List<Integer[]> ans = new ArrayList<>();
		while (pq.size() > 2) {
			A f = pq.poll();
			A s = pq.poll();
			A t = pq.poll();
			f.cnt--;
			s.cnt--;
			t.cnt--;
			Integer[] ints = {f.val, s.val, t.val};
			Arrays.sort(ints, (o1, o2) -> o2 - o1);
			ans.add(ints);
			if (f.cnt>0) {
				pq.add(f);
			}
			if (s.cnt>0) {
				pq.add(s);
			}
			if (t.cnt>0) {
				pq.add(t);
			}
		}
		System.out.println(ans.size());
		for (Integer[] an : ans) {
			System.out.println(an[0] + " " + an[1] + " " + an[2]);
		}
	}

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int n = sc.nextInt();
		int[] a = sc.readArrayInt(n);
		sport(a);
	}

	private static class A {
		int val;
		int cnt;

		public A(int val, int cnt) {
			this.val = val;
			this.cnt = cnt;
		}
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while (!st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

		int[] readArrayInt(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		long nextLong() {
			return Long.parseLong(next());
		}

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