#include <bits/stdc++.h>
using namespace std;
long long n, m, s, t, k, a, b, x, y, u;
const int mod = 1e9 + 7;
const int mxn = 2e5 + 5;
long long mn = 1e18, mx = 0;
long long arr[2000000], wan[2000000], finl[2000000];
string str, str2;
vector<vector<long long> > v(200000), cm(200000);
map<long long, long long> mp, pm;
map<pair<long long, long long>, long long> frq;
int main() {
  ios_base::sync_with_stdio(0);
  t = 1;
  while (t--) {
    cin >> n;
    long long z;
    for (int i = 0; i < n - 2; i++) {
      cin >> x >> y >> z;
      mp[x]++;
      mp[y]++;
      mp[z]++;
      frq[{x, y}]++, frq[{y, x}]++;
      if (frq[{x, y}] == 2) cm[x].push_back(y), cm[y].push_back(x);
      frq[{x, z}]++, frq[{z, x}]++;
      if (frq[{x, z}] == 2) cm[x].push_back(z), cm[z].push_back(x);
      frq[{z, y}]++, frq[{y, z}]++;
      if (frq[{z, y}] == 2) cm[z].push_back(y), cm[y].push_back(z);
    }
    for (int i = 1; i <= n; i++) {
      if (mp[i]) {
        v[mp[i]].push_back(i);
      }
    }
    int l = 0;
    for (int i = 1; i <= 2; i++) {
      long long fr = 0, se = 0;
      long long valf = 0, vals = 0;
      int j = 0;
      for (auto it : v[i]) {
        if (i == 1) {
          arr[l++] = it;
          pm[it]++;
          break;
        } else {
          if (!j)
            fr = frq[{arr[l - 1], it}], valf = it;
          else
            se = frq[{arr[l - 1], it}], vals = it;
          j++;
        }
      }
      if (i != 1) {
        if (fr > se) {
          arr[l++] = valf;
          pm[valf]++;
        } else
          arr[l++] = vals, pm[vals]++;
        ;
      }
    }
    for (int i = 0; i < l; i++) cout << arr[i] << " ";
    long long cn = n - 4;
    while (cn) {
      for (auto i : cm[arr[l - 1]]) {
        if (!pm[i]) {
          pm[i] = 1;
          cout << i << " ";
          arr[l++] = i;
        }
      }
      cn--;
    }
    for (int i = 2; i >= 1; i--) {
      for (auto it : v[i]) {
        if (!pm[it]) {
          cout << it << " ";
        }
      }
    }
  }
  return 0;
}
