#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
const long long maxn = 1e5 + 10, LG = 22, mod = 1e9 + 7, inf = 1e18;
long long n, m, k;
long long q[maxn][3], ted[maxn];
bool mk[maxn];
vector<long long> g[maxn];
bool cmp(long long i, long long j) { return ted[i] < ted[j]; }
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n - 2; i++) {
    cin >> q[i][0] >> q[i][1] >> q[i][2];
    for (auto j : {0, 1, 2}) {
      for (auto k : {0, 1, 2})
        if (j != k) g[q[i][j]].push_back(q[i][k]);
      ted[q[i][j]]++;
    }
  }
  long long s;
  for (int i = 1; i <= n; i++)
    if (ted[i] == 1) s = i;
  deque<long long> q;
  q.push_back(s);
  while ((int)(q.size())) {
    long long v = q.front();
    q.pop_front();
    cout << v << ' ';
    mk[v] = 1;
    vector<long long> vv;
    for (auto u : g[v]) {
      ted[u]--;
      if (!mk[u]) mk[u] = 1, vv.push_back(u);
    }
    sort(vv.begin(), vv.end(), cmp);
    for (auto x : vv) q.push_back(x);
  }
  return 0;
}
