#include <bits/stdc++.h>
using namespace std;
char sl = '\n';
set<int> number[100000 + 1];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  map<int, map<int, bool> > nb;
  for (int i = 0; i < n - 2; ++i) {
    int x, y, z;
    cin >> x >> y >> z;
    number[x].insert(i);
    number[y].insert(i);
    number[z].insert(i);
    nb[i][x] = true;
    nb[i][y] = true;
    nb[i][z] = true;
  }
  int j = 0;
  for (int i = 0; i < 100000 + 1 && !j; ++i)
    if (number[i].size() == 1) j = i;
  vector<int> ans;
  ans.push_back(j);
  int tp1, tp2;
  for (auto i : nb[*number[j].begin()]) {
    if (number[i.first].size() == 2) tp1 = i.first;
    if (number[i.first].size() == 3) tp2 = i.first;
  }
  ans.push_back(tp1);
  ans.push_back(tp2);
  int df = j;
  j = ans[ans.size() - 1];
  number[j].erase((*number[df].begin()));
  int dd = 3;
  while (dd < n) {
    for (int i : number[j]) {
      if (nb[i][ans[ans.size() - 2]]) {
        int x = ans[ans.size() - 1];
        int y = ans[ans.size() - 2];
        for (auto k : nb[i]) {
          if (k.second && (k.first != x && k.first != y)) {
            ans.push_back(k.first);
            dd++;
          }
        }
        number[ans[ans.size() - 1]].erase(i);
        break;
      }
    }
    j = ans[ans.size() - 1];
  }
  for (int i : ans) cout << i << " ";
  cout << sl;
  return 0;
}
