#include <bits/stdc++.h>
using namespace std;
vector<int> d1[100013];
int d[100013];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 2; i++) {
    int d, p, k;
    cin >> d >> p >> k;
    d1[d].push_back(p);
    d1[d].push_back(k);
    d1[p].push_back(d);
    d1[p].push_back(k);
    d1[k].push_back(d);
    d1[k].push_back(p);
  }
  int p;
  for (int i = 1; i <= n; i++) {
    if (d1[i].size() == 2) {
      p = i;
      break;
    }
  }
  cout << p << " ";
  d[p] = 1;
  int k = d1[p][0];
  int h = d1[p][1];
  if (d1[h].size() == 4) {
    swap(k, h);
  }
  cout << k << ' ' << h;
  d[k] = 1;
  d[h] = 1;
  for (int i = 4; i <= n; i++) {
    for (int j = 0; j < d1[k].size(); j++) {
      if (d[d1[k][j]] == 0) {
        cout << " " << d1[k][j];
        d[d1[k][j]] = 1;
        p = h;
        h = d1[k][j];
        k = p;
        break;
      }
    }
  }
  cout << endl;
  return 0;
}
