#include <bits/stdc++.h>
using namespace std;
const int MAXSIZE = 1e5 + 10;
set<int> A[MAXSIZE];
set<int> P[MAXSIZE];
set<int> usedN;
int sol[MAXSIZE];
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n - 2; i++) {
    for (int j = 0; j < 3; j++) {
      int t;
      cin >> t;
      P[i].insert(t);
      A[t].insert(i);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (A[i].size() == 1) {
      sol[0] = i;
      for (auto e : P[*A[i].begin()]) {
        if (A[e].size() == 2) {
          sol[1] = e;
        }
      }
      break;
    }
  }
  for (int i = 0; i < 2; i++) {
    usedN.insert(sol[i]);
  }
  int k = 2;
  while (k <= n) {
    int x = k - 2;
    bool work = true;
    for (auto p : A[sol[x]]) {
      for (auto e : P[p]) {
        if (usedN.insert(e).second == true) {
          sol[k] = e;
          work = false;
          break;
        }
      }
      if (!work) break;
    }
    k++;
  }
  for (int i = 0; i < n; i++) {
    cout << sol[i] << " \n"[i == (n - 1)];
  }
  return 0;
}
