#include <bits/stdc++.h>
using namespace std;
vector<int> d[111111];
int n;
int a[111111], b[111111], c[111111], kq[111111], dd[111111];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n - 2; i++) {
    cin >> a[i] >> b[i] >> c[i];
    d[a[i]].push_back(i);
    d[b[i]].push_back(i);
    d[c[i]].push_back(i);
  }
  for (int i = 1; i <= n - 2; i++) {
    if (d[a[i]].size() == 1 || d[b[i]].size() == 1 || d[c[i]].size() == 1) {
      dd[i] = 1;
      for (int j = 1; j <= 3; j++) {
        if (d[a[i]].size() == j) kq[j] = a[i];
        if (d[b[i]].size() == j) kq[j] = b[i];
        if (d[c[i]].size() == j) kq[j] = c[i];
      }
      break;
    }
  }
  for (int i = 1; i <= n - 3; i++) {
    for (auto u : d[kq[i + 1]]) {
      for (auto v : d[kq[i + 2]]) {
        if (u == v && dd[u] == 0) {
          kq[i + 3] = a[u] + b[u] + c[u] - kq[i + 1] - kq[i + 2];
          dd[u] = 1;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) cout << kq[i] << " ";
  cout << "\n";
}
