#include <bits/stdc++.h>
using namespace std;
int64_t inf = 1000 * 1000 * 1000 + 5;
int64_t inf64 = inf * inf;
int64_t mod = 228228227;
int64_t nll = 0;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cerr << fixed << setprecision(10);
  cout << fixed << setprecision(10);
  srand(time(0));
  double START_TIME = clock();
  int32_t n;
  cin >> n;
  map<int32_t, int32_t> q, k;
  map<int32_t, set<pair<int32_t, pair<int32_t, int32_t> > > > d;
  for (int32_t i = 0; i < n - 2; ++i) {
    int32_t x, y, z;
    cin >> x >> y >> z;
    ++q[x];
    ++q[y];
    ++q[z];
    ++k[x];
    ++k[y];
    ++k[z];
    d[x].insert(make_pair(x, make_pair(y, z)));
    d[y].insert(make_pair(x, make_pair(y, z)));
    d[z].insert(make_pair(x, make_pair(y, z)));
  }
  set<pair<int32_t, int32_t> > st;
  for (auto &c : q) st.emplace(c.second, c.first);
  int32_t start = st.begin()->second;
  for (int32_t i = 0; i < n - 3; ++i) {
    cout << start << " ";
    auto t = d[start];
    int32_t x, y, z;
    x = t.begin()->first;
    y = (t.begin()->second).first;
    z = (t.begin()->second).second;
    --q[x];
    --q[y];
    --q[z];
    auto r = make_pair(x, make_pair(y, z));
    d[x].erase(r);
    d[y].erase(r);
    d[z].erase(r);
    d[start].clear();
    int32_t idx = -1;
    if (q[x] == 1) idx = x;
    if (q[y] == 1) idx = y;
    if (q[z] == 1) idx = z;
    start = idx;
  }
  vector<pair<int32_t, int32_t> > o;
  for (auto &c : q) {
    if (c.second != 0) {
      o.emplace_back(k[c.first], c.first);
    }
  }
  sort(o.rbegin(), o.rend());
  for (auto &c : o) cout << c.second << " ";
  cerr << endl << (clock() - START_TIME) / CLOCKS_PER_SEC << " sec." << endl;
}
