#include <bits/stdc++.h>
using namespace std;
const int INF = 1e6 + 9;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<unordered_set<int> > vet2(n + 2);
  int vet[4];
  for (int i = 0; i < n - 2; i++) {
    for (int j = 0; j < 3; j++) cin >> vet[j];
    for (int j = 0; j < 3; j++) {
      for (int k = 0; k < 3; k++) {
        if (j == k) continue;
        vet2[vet[j]].insert(vet[k]);
      }
    }
  }
  vector<int> f;
  vector<int> s;
  for (int i = 1; i <= n; i++) {
    if ((int)vet2[i].size() == 2) f.push_back(i);
    if ((int)vet2[i].size() == 3) s.push_back(i);
  }
  long long ans[100009];
  ans[0] = f[0], ans[n - 1] = f.back();
  if (vet2[f[0]].count(s[0]))
    ans[1] = s[0], ans[n - 2] = s[1];
  else
    ans[1] = s[1], ans[n - 2] = s[0];
  vet2[ans[1]].erase(ans[0]);
  for (int i = 0; i < n - 4; i++) {
    vet2[ans[i]].erase(ans[i + 1]);
    ans[i + 2] = *vet2[ans[i]].begin();
    vet2[ans[i + 2]].erase(ans[i]);
    vet2[ans[i + 2]].erase(ans[i + 1]);
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
  return 0;
}
