#include <bits/stdc++.h>
using namespace std;
int c[100100], visi[100100];
set<int> gr[100100];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 2; ++i) {
    int x, y, z;
    cin >> x >> y >> z;
    gr[x].insert(y);
    gr[x].insert(z);
    gr[y].insert(x);
    gr[y].insert(z);
    gr[z].insert(x);
    gr[z].insert(y);
    c[x]++;
    c[y]++;
    c[z]++;
  }
  vector<int> ans;
  int sta;
  int x, y;
  for (int i = 1; i <= n; ++i) {
    if (c[i] == 1) {
      sta = i;
      int mi = 10;
      for (int l : gr[sta]) {
        if (c[l] < mi) {
          y = x;
          x = l;
          mi = c[l];
        } else
          y = l;
      }
      break;
    }
  }
  if (n == 4) {
    for (int l : gr[sta]) ans.push_back(l);
    ans.push_back(10 - (ans[0] + ans[1] + ans[2]));
    for (int l : ans) cout << l << " ";
    cout << endl;
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    ans.push_back(sta);
    gr[x].erase(sta);
    gr[y].erase(sta);
    gr[y].erase(x);
    visi[sta] = 1;
    visi[x] = 1;
    sta = x;
    x = y;
    gr[y].erase(x);
    for (int l : gr[x]) {
      if (!visi[l] && gr[l].find(sta) != gr[l].end()) {
        y = l;
      }
    }
  }
  for (int l : ans) cout << l << " ";
  cout << endl;
  return 0;
}
