#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 50;
int n, a[N][3], cnt[N], ans[N];
int fir[2], sec[2];
map<pair<int, int>, int> mp, mpp;
bool vis[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int x, i = 1; i <= n - 2; i++) {
    for (int j = 0; j < 3; j++) cin >> a[i][j], cnt[a[i][j]]++;
    sort(a[i], a[i] + 3);
    if (mp.count(make_pair(a[i][0], a[i][1])))
      mpp[make_pair(a[i][0], a[i][1])] = a[i][2];
    else
      mp[make_pair(a[i][0], a[i][1])] = a[i][2];
    if (mp.count(make_pair(a[i][0], a[i][2])))
      mpp[make_pair(a[i][0], a[i][2])] = a[i][1];
    else
      mp[make_pair(a[i][0], a[i][2])] = a[i][1];
    if (mp.count(make_pair(a[i][1], a[i][2])))
      mpp[make_pair(a[i][1], a[i][2])] = a[i][0];
    else
      mp[make_pair(a[i][1], a[i][2])] = a[i][0];
  }
  for (int i = 1; i <= n; i++)
    if (cnt[i] == 1) {
      if (fir[0] == 0)
        fir[0] = i;
      else
        fir[1] = i;
    } else if (cnt[i] == 2) {
      if (sec[0] == 0)
        sec[0] = i;
      else
        sec[1] = i;
    }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      bool o = true;
      int x = fir[i], y = sec[j], z;
      if (mp.count(make_pair(min(x, y), max(x, y))))
        z = mp[make_pair(min(x, y), max(x, y))];
      else
        continue;
      ans[1] = x;
      ans[2] = y;
      ans[3] = z;
      for (int j = 4; j <= n; j++) {
        if (mp.count(make_pair(min(y, z), max(y, z))) and
            mp[make_pair(min(y, z), max(y, z))] != x) {
          ans[j] = mp[make_pair(min(y, z), max(y, z))];
          x = y, y = z, z = ans[j];
        } else if (mpp.count(make_pair(min(y, z), max(y, z))) and
                   mpp[make_pair(min(y, z), max(y, z))] != x) {
          ans[j] = mpp[make_pair(min(y, z), max(y, z))];
          x = y, y = z, z = ans[j];
        } else {
          o = false;
          break;
        }
      }
      if (o) {
        for (int i = 1; i <= n; i++) cout << ans[i] << " ";
        return 0;
      }
    }
  }
}
