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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
struct rep {
  int id, num;
  rep() {}
  rep(int id, int num) : id(id), num(num) {}
  bool operator<(const rep &d) const { return num < d.num; }
} a[100005];
struct node {
  int a, b, c;
  node() {}
  node(int a, int b, int c) : a(a), b(b), c(c) {}
  void out() {
    int x[5];
    x[0] = a;
    x[1] = b;
    x[2] = c;
    sort(x, x + 3);
    printf("%d %d %d\n", x[2], x[1], x[0]);
  }
} ans[100005];
int b[100005], n, r[100005], p1, p2, num;
priority_queue<rep> q;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &r[i]);
  sort(r, r + n);
  p1 = p2 = 0;
  int ct = 1, tar = r[0];
  for (int i = 1; i < n; ++i) {
    if (r[i] != tar) {
      if (ct > 1)
        q.push(rep(tar, ct));
      else
        b[p2++] = tar;
      ct = 1;
      tar = r[i];
    } else
      ++ct;
  }
  if (ct > 1)
    q.push(rep(tar, ct));
  else
    b[p2++] = tar;
  num = 0;
  while (q.size() >= 3) {
    rep t1 = q.top();
    q.pop();
    rep t2 = q.top();
    q.pop();
    rep t3 = q.top();
    q.pop();
    t1.num--;
    t2.num--;
    t3.num--;
    ans[num++] = node(t1.id, t2.id, t3.id);
    if (t1.num > 1)
      q.push(t1);
    else
      b[p2++] = t1.id;
    if (t2.num > 1)
      q.push(t2);
    else
      b[p2++] = t2.id;
    if (t3.num > 1)
      q.push(t3);
    else
      b[p2++] = t3.id;
  }
  while (q.size() >= 2 && p2 >= 1) {
    rep t1 = q.top();
    q.pop();
    rep t2 = q.top();
    q.pop();
    int t3 = b[--p2];
    t1.num--;
    t2.num--;
    ans[num++] = node(t1.id, t2.id, t3);
    if (t1.num > 1)
      q.push(t1);
    else
      b[p2++] = t1.id;
    if (t2.num > 1)
      q.push(t2);
    else
      b[p2++] = t2.id;
  }
  while (q.size() >= 1 && p2 >= 2) {
    rep t1 = q.top();
    q.pop();
    int t2 = b[--p2];
    int t3 = b[--p2];
    t1.num--;
    ans[num++] = node(t1.id, t2, t3);
    if (t1.num > 1)
      q.push(t1);
    else
      b[p2++] = t1.id;
  }
  while (p2 >= 3) {
    int t1 = b[--p2];
    int t2 = b[--p2];
    int t3 = b[--p2];
    ans[num++] = node(t1, t2, t3);
  }
  printf("%d\n", num);
  for (int i = 0; i < num; ++i) ans[i].out();
  return 0;
}