#include <bits/stdc++.h>
using namespace std;
int n;
int cnt[100005];
bool vis[100005];
vector<int> adj[100005];
map<pair<int, int>, bool> mp;
vector<int> v;
int main() {
  cin >> n;
  for (int i = 0; i < n - 2; ++i) {
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    ++cnt[a[0]];
    ++cnt[a[1]];
    ++cnt[a[2]];
    sort(a, a + 3);
    if (!mp[{a[0], a[1]}]) {
      mp[{a[0], a[1]}] = 1;
      adj[a[0]].push_back(a[1]);
      adj[a[1]].push_back(a[0]);
    }
    if (!mp[{a[0], a[2]}]) {
      mp[{a[0], a[2]}] = 1;
      adj[a[0]].push_back(a[2]);
      adj[a[2]].push_back(a[0]);
    }
    if (!mp[{a[1], a[2]}]) {
      mp[{a[1], a[2]}] = 1;
      adj[a[1]].push_back(a[2]);
      adj[a[2]].push_back(a[1]);
    }
  }
  for (int i = 1; i <= n; ++i)
    if (cnt[i] == 1) {
      v.push_back(i);
      int x = adj[i][0];
      int y = adj[i][1];
      if (cnt[x] == 2) {
        v.push_back(x);
        v.push_back(y);
      } else {
        v.push_back(y);
        v.push_back(x);
      }
      vis[i] = 1;
      vis[x] = 1;
      vis[y] = 1;
      break;
    }
  int p = 1;
  for (p; p < v.size(); ++p) {
    for (auto nx : adj[v[p]])
      if (!vis[nx]) {
        vis[nx] = 1;
        v.push_back(nx);
      }
  }
  for (int nx : v) cout << nx << " ";
  return 0;
}
