#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 10;
const long long INF = 1e18;
long long n, cnt[maxn], mark[maxn], ans[maxn];
vector<pair<pair<long long, long long>, long long> > vv[maxn];
pair<pair<long long, long long>, long long> kodom(long long x) {
  for (auto pp : vv[x]) {
    if (mark[pp.first.first] == 0 && mark[pp.first.second] == 0 &&
        mark[pp.second] == 0)
      return pp;
  }
}
long long felan(long long x, long long y) {
  long long anss = 0;
  for (auto pp : vv[x]) {
    if (pp.first.first == y || pp.first.second == y || pp.second == y) anss++;
  }
  return anss;
}
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n - 2; i++) {
    long long x, y, z;
    cin >> x >> y >> z;
    cnt[x]++;
    cnt[y]++;
    cnt[z]++;
    vv[x].push_back({{x, y}, z});
    vv[y].push_back({{x, y}, z});
    vv[z].push_back({{x, y}, z});
  }
  for (int i = 1; i <= n; i++) {
    if (cnt[i] == 1) {
      ans[1] = i;
      break;
    }
  }
  long long x = ans[1];
  ans[2] = vv[x][0].first.first * (cnt[vv[x][0].first.first] == 2) +
           vv[x][0].first.second * (cnt[vv[x][0].first.second] == 2) +
           vv[x][0].second * (cnt[vv[x][0].second] == 2);
  ans[3] = vv[x][0].first.first * (cnt[vv[x][0].first.first] == 3) +
           vv[x][0].first.second * (cnt[vv[x][0].first.second] == 3) +
           vv[x][0].second * (cnt[vv[x][0].second] == 3);
  mark[ans[1]] = 1;
  mark[ans[2]] = 1;
  for (int i = 3; i < n - 1; i++) {
    long long x = ans[i];
    auto pp = kodom(x);
    long long x1 = pp.first.first, x2 = pp.first.second, x3 = pp.second;
    ans[i + 1] = (felan(x, x1) == 2) * x1 + (felan(x, x2) == 2) * x2 +
                 (felan(x, x3) == 2) * x3;
    mark[ans[i]] = 1;
  }
  mark[ans[n - 1]] = 1;
  for (int i = 1; i <= n; i++) {
    if (mark[i] == 0) ans[n] = i;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
