#include <bits/stdc++.h>
using namespace std;
const long long int inf = 9e18;
const long double pi = 2 * acos(0.0);
long long int t, n;
vector<long long int> arr, prr;
vector<vector<long long int>> brr, crr;
vector<bool> rec;
long long int power(long long int x, long long int y) {
  long long int res = 1ll;
  while (y > 0) {
    if (y & 1) res = res * x;
    y >>= 1;
    x = x * x;
  }
  return res;
}
void solve() {
  cin >> n;
  crr.resize(n + 1), brr.resize(n - 2), rec.resize(n + 1, false);
  ;
  for (int i = 0; i < n - 2; i++) brr[i].resize(3);
  ;
  for (int i = 0; i < n - 2; i++) cin >> brr[i][0] >> brr[i][1] >> brr[i][2];
  ;
  for (int i = 0; i < n - 2; i++) {
    crr[brr[i][0]].push_back(brr[i][1]), crr[brr[i][0]].push_back(brr[i][2]);
    crr[brr[i][1]].push_back(brr[i][0]), crr[brr[i][1]].push_back(brr[i][2]);
    crr[brr[i][2]].push_back(brr[i][1]), crr[brr[i][2]].push_back(brr[i][0]);
  }
  long long int st;
  ;
  for (int i = 1; i < n + 1; i++) {
    if ((int)((crr[i]).size()) == 2) {
      st = i;
      break;
    }
  }
  prr.push_back(st), rec[st] = true;
  vector<long long int> drr(n + 1, 0);
  drr[st] = 1;
  vector<pair<long long int, long long int>> temp;
  ;
  for (int i = 0; i < (int)((crr[st]).size()); i++) {
    if (!rec[crr[st][i]]) {
      temp.push_back(make_pair((int)((crr[crr[st][i]]).size()), crr[st][i]));
      drr[crr[st][i]]++;
    }
  }
  sort(temp.begin(), temp.end());
  st = temp[0].second;
  rec[st] = true, prr.push_back(st);
  while ((int)((prr).size()) != n) {
    vector<pair<long long int, long long int>> temp;
    ;
    for (int i = 0; i < (int)((crr[st]).size()); i++) {
      if (!rec[crr[st][i]]) {
        temp.push_back(make_pair(drr[crr[st][i]], crr[st][i]));
        drr[crr[st][i]]++;
      }
    }
    sort(temp.rbegin(), temp.rend());
    st = temp[0].second;
    rec[st] = true, prr.push_back(st);
  };
  for (int i = 0; i < (int)((prr).size()); i++) cout << prr[i] << " ";
}
int32_t main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  t = 1;
  while (t--) {
    solve();
  }
}
