#include <bits/stdc++.h>
const int M = 1e5 + 19;
using namespace std;
int main() {
  int n;
  cin >> n;
  int a1, a2, a3;
  set<int> adj[n + 1];
  for (int i = 0; i < n - 2; i++) {
    cin >> a1 >> a2 >> a3;
    adj[a1].insert(a2);
    adj[a1].insert(a3);
    adj[a2].insert(a1);
    adj[a2].insert(a3);
    adj[a3].insert(a1);
    adj[a3].insert(a2);
  }
  vector<int> p;
  int j;
  for (j = 1; j <= n; j++) {
    if (adj[j].size() == 2) {
      p.push_back(j);
      break;
    }
  }
  set<int>::iterator it = adj[j].begin();
  if (adj[*it].size() == 3) {
    p.push_back(*it);
    adj[j].erase(p.back());
    p.push_back(*adj[j].begin());
    adj[j].erase(p.back());
  } else {
    it++;
    p.push_back(*it);
    adj[j].erase(p.back());
    p.push_back(*adj[j].begin());
    adj[j].erase(p.back());
  }
  adj[p[1]].erase(p[0]);
  adj[p[1]].erase(p[2]);
  adj[p[2]].erase(p[0]);
  adj[p[2]].erase(p[1]);
  int l;
  while (p.size() < n) {
    l = p.size();
    p.push_back(*adj[p[l - 2]].begin());
    adj[p[l - 1]].erase(p[l]);
    adj[p[l - 2]].erase(p[l]);
    adj[p[l]].erase(p[l - 1]);
    adj[p[l]].erase(p[l - 2]);
  }
  for (int i = 0; i < n; i++) {
    cout << p[i] << " ";
  }
}
