#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> seen(n + 1);
  vector<int> added(n + 1);
  vector<int> nxt;
  vector<vector<int>> conn(n + 1);
  set<pair<int, int>> occ;
  for (int i = 0; i < n - 2; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    conn[a].push_back(b);
    conn[a].push_back(c);
    conn[b].push_back(a);
    conn[b].push_back(c);
    conn[c].push_back(a);
    conn[c].push_back(b);
  }
  int start;
  for (int i = 1; i <= n; i++) {
    if (conn[i].size() == 2) {
      start = i;
      break;
    }
  }
  nxt.push_back(start);
  int pos = 0;
  vector<int> order;
  while (pos < nxt.size()) {
    order.push_back(nxt[pos]);
    seen[nxt[pos]] = 1;
    vector<int> cands;
    for (auto a : conn[nxt[pos]]) {
      if (!seen[a] && !added[a]) {
        cands.push_back(a);
      }
    }
    if (cands.size() > 1) {
      if (conn[cands[0]].size() == 4) {
        nxt.push_back(cands[0]);
        nxt.push_back(cands[1]);
        added[cands[0]] = 1;
        added[cands[1]] = 1;
      } else {
        nxt.push_back(cands[1]);
        nxt.push_back(cands[0]);
        added[cands[0]] = 1;
        added[cands[1]] = 1;
      }
    } else if (cands.size() == 1) {
      nxt.push_back(cands[0]);
      added[cands[0]] = 1;
    }
    pos += 1;
  }
  for (auto a : order) {
    cout << a << " ";
  }
  cout << "\n";
  return 0;
}
