#include <bits/stdc++.h>
using namespace std;
void test() {
  long long n;
  cin >> n;
  vector<bool> vis(n + 1, false);
  vector<int> v[n + 1];
  map<long long, long long> m;
  vector<long long> ans;
  for (long long i = 0; i < n - 2; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    v[a].push_back(c);
    v[b].push_back(c);
    v[b].push_back(a);
    v[c].push_back(a);
    v[a].push_back(b);
    v[c].push_back(b);
    m[a]++, m[b]++, m[c]++;
  }
  long long z;
  for (long long i = 1; i < n + 1; i++) {
    if (m[i] == 1) {
      z = i;
      break;
    }
  }
  queue<long long> q;
  q.push(z);
  vis[z] = true;
  while (!q.empty()) {
    z = q.front();
    q.pop();
    ans.push_back(z);
    for (long long i = 0; i < v[z].size(); i++) {
      if (vis[v[z][i]] == false && m[v[z][i]] == 2) {
        q.push(v[z][i]);
        vis[v[z][i]] = true;
      }
    }
    for (long long i = 0; i < v[z].size(); i++) {
      if (vis[v[z][i]] == false && m[v[z][i]] == 1) {
        q.push(v[z][i]);
        vis[v[z][i]] = true;
      }
    }
    for (long long i = 0; i < v[z].size(); i++) {
      if (vis[v[z][i]] == false && m[v[z][i]] == 3) {
        q.push(v[z][i]);
        vis[v[z][i]] = true;
      }
    }
  }
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t = 1;
  while (t--) {
    test();
  }
  return 0;
}
