#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int MOD = 1000003;
const int N = 2e6 + 10;
const ll INF = 9e18;
const int M = 1010;
int q1[N], q2[N], q3[N];
int cnt[N];
int ans[N];
bool used[N];
vector<pair<pair<int, int>, int> > a[N];
map<pair<int, int>, vector<int> > x;
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i <= n - 2; ++i) {
    cin >> q1[i] >> q2[i] >> q3[i];
    cnt[q1[i]]++;
    cnt[q2[i]]++;
    cnt[q3[i]]++;
    x[{q1[i], q2[i]}].push_back(q3[i]);
    x[{q1[i], q3[i]}].push_back(q2[i]);
    x[{q2[i], q3[i]}].push_back(q1[i]);
  }
  int pos = 0, pos1 = 0;
  for (int i = 1; i <= n; ++i) {
    if (cnt[q1[i]] == 1) (pos == 0 ? pos : pos1) = i;
    if (cnt[q2[i]] == 1) (pos == 0 ? pos : pos1) = i;
    if (cnt[q3[i]] == 1) (pos == 0 ? pos : pos1) = i;
  }
  int cur1 = 0, cur2 = 0;
  if (cnt[q1[pos]] == 1) ans[1] = q1[pos], cur1 = q1[pos];
  if (cnt[q2[pos]] == 1) ans[1] = q2[pos], cur1 = q2[pos];
  if (cnt[q3[pos]] == 1) ans[1] = q3[pos], cur1 = q3[pos];
  if (cnt[q1[pos]] == 2) ans[2] = q1[pos], cur2 = q1[pos];
  if (cnt[q2[pos]] == 2) ans[2] = q2[pos], cur2 = q2[pos];
  if (cnt[q3[pos]] == 2) ans[2] = q3[pos], cur2 = q3[pos];
  int cnt = 3;
  used[cur1] = 1;
  used[cur2] = 1;
  for (int i = 1; i <= n - 2; ++i) {
    bool ok = 0;
    for (int j = 0; j < (x[{cur1, cur2}]).size(); ++j) {
      int z = x[{cur1, cur2}][j];
      if (used[z] == 1) continue;
      ok = 1;
      x[{cur1, cur2}].erase(x[{cur1, cur2}].begin() + j);
      cur1 = cur2;
      cur2 = z;
      used[z] = 1;
      ans[cnt] = z;
      cnt++;
      break;
    }
    if (ok) continue;
    for (int j = 0; j < (x[{cur2, cur1}]).size(); ++j) {
      int z = x[{cur2, cur1}][j];
      if (used[z] == 1) continue;
      ok = 1;
      x[{cur2, cur1}].erase(x[{cur2, cur1}].begin() + j);
      cur1 = cur2;
      cur2 = z;
      used[z] = 1;
      ans[cnt] = z;
      cnt++;
      break;
    }
  }
  for (int i = 1; i <= n; ++i) cout << ans[i] << ' ';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
}
