#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
map<int, int>::iterator it;
priority_queue<pair<int, int> > Q;
int ans[100000][3];
int main() {
  int n, i, x, k;
  while (~scanf("%d", &n)) {
    for (i = 0; i < n; ++i) {
      scanf("%d", &x);
      ++m[x];
    }
    for (it = m.begin(); it != m.end(); it++)
      Q.push(make_pair(it->second, it->first));
    k = 0;
    while (Q.size() >= 3) {
      pair<int, int> A = Q.top();
      Q.pop();
      pair<int, int> B = Q.top();
      Q.pop();
      pair<int, int> C = Q.top();
      Q.pop();
      ans[k][0] = A.second, ans[k][1] = B.second, ans[k][2] = C.second;
      sort(ans[k], ans[k] + 3);
      ++k;
      if (--A.first > 0) Q.push(A);
      if (--B.first > 0) Q.push(B);
      if (--C.first > 0) Q.push(C);
    }
    printf("%d\n", k);
    for (i = 0; i < k; i++)
      printf("%d %d\n %d\n", ans[i][2], ans[i][1], ans[i][0]);
  }
  return 0;
}
