#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  map<pair<int, int>, int> third1;
  map<pair<int, int>, int> third2;
  vector<int> cnt(n + 1, 0);
  vector<int> a;
  vector<vector<int>> x;
  for (int i = 0; i < n - 2; i++) {
    vector<int> cur(3);
    cin >> cur[0] >> cur[1] >> cur[2];
    x.push_back(cur);
    sort((cur).begin(), (cur).end());
    if (third1.count({cur[0], cur[1]}) == 0)
      third1[{cur[0], cur[1]}] = cur[2];
    else
      third2[{cur[0], cur[1]}] = cur[2];
    if (third1.count({cur[0], cur[2]}) == 0)
      third1[{cur[0], cur[2]}] = cur[1];
    else
      third2[{cur[0], cur[2]}] = cur[1];
    if (third1.count({cur[1], cur[2]}) == 0)
      third1[{cur[1], cur[2]}] = cur[0];
    else
      third2[{cur[1], cur[2]}] = cur[0];
    for (int j = 0; j < 3; j++) cnt[cur[j]]++;
  }
  for (int i = 0; i < n - 2; i++) {
    for (int j = 0; j < 3; j++) {
      for (int k = 0; k < 3; k++) {
        int u = x[i][j], v = x[i][k];
        if (cnt[u] == 1 && cnt[v] == 2) {
          a.push_back(u);
          a.push_back(v);
          vector<int> used(n + 1, 0);
          used[u] = 1, used[v] = 1;
          for (int i = 2; i < n; i++) {
            int o = a[i - 1], l = a[i - 2];
            if (o > l) swap(o, l);
            if (used[third1[{o, l}]]) {
              a.push_back(third2[{o, l}]);
            } else {
              a.push_back(third1[{o, l}]);
            }
            used[a[i]] = 1;
          }
          for (int i = 0; i < n; i++) {
            cout << a[i] << ' ';
          }
          return 0;
        }
      }
    }
  }
  return 0;
}
