#include <bits/stdc++.h>
using namespace std;
void dbg_out() { cerr << "\b\b]\n"; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << H << ", ";
  dbg_out(T...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<set<int>> A(n);
  vector<int> cnts(n + 1, 0);
  vector<set<int>> mp(n + 1);
  for (int i = 0; i < n - 2; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    A[i].insert({a, b, c});
    cnts[a]++;
    cnts[b]++;
    cnts[c]++;
    mp[a].insert(i);
    mp[b].insert(i);
    mp[c].insert(i);
  }
  int a = -1, b = -1, c = -1, d = -1;
  for (int i = 1; i <= n; ++i) {
    if (cnts[i] == 1) {
      if (a == -1)
        a = i;
      else
        b = i;
    }
    if (cnts[i] == 2) {
      if (c == -1)
        c = i;
      else
        d = i;
    }
  }
  assert(a > -1 and b > -1 and c > -1 and d > -1);
  bool yes = false;
  for (int i = 0; i < n - 2; ++i) {
    if (A[i].count(a) and A[i].count(c)) {
      yes = true;
      break;
    }
  }
  vector<int> ans(n);
  int x, y;
  if (yes) {
    ans[0] = a;
    ans[1] = c;
    x = a, y = c;
  } else {
    ans[0] = a;
    ans[1] = d;
    x = a, y = d;
  }
  for (int i = 2; i < n; ++i) {
    int idx = *mp[x].begin();
    set<int> curr = {x, y};
    int z = -1;
    for (auto j : A[idx]) {
      mp[j].erase(idx);
      if (curr.count(j)) continue;
      z = j;
    }
    ans[i] = z;
    x = y;
    y = z;
  }
  for (int i : ans) cout << i << ' ';
  return 0;
}
