#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = 4 * atan(1);
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
int nCase = 0;
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
template <class T>
inline bool read(T &n) {
  T x = 0, tmp = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-' && c != EOF) c = getchar();
  if (c == EOF) return false;
  if (c == '-') c = getchar(), tmp = -1;
  while (c >= '0' && c <= '9') x *= 10, x += (c - '0'), c = getchar();
  n = x * tmp;
  return true;
}
template <class T>
inline void write(T n) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  int len = 0, data[20];
  while (n) {
    data[len++] = n % 10;
    n /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
}
long long QMOD(long long x, long long k) {
  long long res = 1LL;
  while (k) {
    if (k & 1) res = res * x % MOD;
    k >>= 1;
    x = x * x % MOD;
  }
  return res;
}
int n;
priority_queue<pair<int, int> > q;
map<int, int> mp;
vector<pair<pair<int, int>, int> > v;
inline bool check(int mid) {
  priority_queue<pair<int, int> > que = q;
  int cnt = 0;
  v.clear();
  while (que.size() > 2 && cnt < mid) {
    pair<int, int> f1 = que.top();
    que.pop();
    pair<int, int> f2 = que.top();
    que.pop();
    pair<int, int> f3 = que.top();
    que.pop();
    int a = f1.second;
    int b = f2.second;
    int c = f3.second;
    if (a < b) swap(a, b);
    if (a < c) swap(a, c);
    if (b < c) swap(b, c);
    v.push_back(pair<pair<int, int>, int>(pair<int, int>(a, b), c));
    ++cnt;
    if (--f1.first > 0) que.push(f1);
    if (--f2.first > 0) que.push(f2);
    if (--f3.first > 0) que.push(f3);
  }
  return cnt >= mid;
}
int main(int argc, const char *argv[]) {
  scanf("%d", &n);
  for (int i = 1, x; i <= n; ++i) {
    read(x);
    mp[x]++;
  }
  map<int, int>::iterator it;
  for (it = mp.begin(); it != mp.end(); ++it) {
    q.push(pair<int, int>(it->second, it->first));
  }
  int l = 0, r = n / 3;
  int ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid) == true) {
      l = mid + 1;
      ans = mid;
    } else
      r = mid - 1;
  }
  printf("%d\n", ans);
  if (ans > 0) {
    for (int i = 0; i < ans; ++i)
      printf("%d %d %d\n", v[i].first.first, v[i].first.second, v[i].second);
  }
  return 0;
}

### Prompt

Please formulate a Cpp solution to the following 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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = 4 * atan(1);
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
int nCase = 0;
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
template <class T>
inline bool read(T &n) {
  T x = 0, tmp = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-' && c != EOF) c = getchar();
  if (c == EOF) return false;
  if (c == '-') c = getchar(), tmp = -1;
  while (c >= '0' && c <= '9') x *= 10, x += (c - '0'), c = getchar();
  n = x * tmp;
  return true;
}
template <class T>
inline void write(T n) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  int len = 0, data[20];
  while (n) {
    data[len++] = n % 10;
    n /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
}
long long QMOD(long long x, long long k) {
  long long res = 1LL;
  while (k) {
    if (k & 1) res = res * x % MOD;
    k >>= 1;
    x = x * x % MOD;
  }
  return res;
}
int n;
priority_queue<pair<int, int> > q;
map<int, int> mp;
vector<pair<pair<int, int>, int> > v;
inline bool check(int mid) {
  priority_queue<pair<int, int> > que = q;
  int cnt = 0;
  v.clear();
  while (que.size() > 2 && cnt < mid) {
    pair<int, int> f1 = que.top();
    que.pop();
    pair<int, int> f2 = que.top();
    que.pop();
    pair<int, int> f3 = que.top();
    que.pop();
    int a = f1.second;
    int b = f2.second;
    int c = f3.second;
    if (a < b) swap(a, b);
    if (a < c) swap(a, c);
    if (b < c) swap(b, c);
    v.push_back(pair<pair<int, int>, int>(pair<int, int>(a, b), c));
    ++cnt;
    if (--f1.first > 0) que.push(f1);
    if (--f2.first > 0) que.push(f2);
    if (--f3.first > 0) que.push(f3);
  }
  return cnt >= mid;
}
int main(int argc, const char *argv[]) {
  scanf("%d", &n);
  for (int i = 1, x; i <= n; ++i) {
    read(x);
    mp[x]++;
  }
  map<int, int>::iterator it;
  for (it = mp.begin(); it != mp.end(); ++it) {
    q.push(pair<int, int>(it->second, it->first));
  }
  int l = 0, r = n / 3;
  int ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid) == true) {
      l = mid + 1;
      ans = mid;
    } else
      r = mid - 1;
  }
  printf("%d\n", ans);
  if (ans > 0) {
    for (int i = 0; i < ans; ++i)
      printf("%d %d %d\n", v[i].first.first, v[i].first.second, v[i].second);
  }
  return 0;
}

```