#include <bits/stdc++.h>
using namespace std;
bool vis[200000];
long long cou[200000];
int32_t main() {
  long long n;
  cin >> n;
  set<long long> S[n - 2];
  map<pair<long long, long long>, vector<long long>> mp;
  for (long long i = 0; i < n - 2; i++) {
    set<long long> p;
    long long arr[3];
    cin >> arr[0] >> arr[1] >> arr[2];
    sort(arr, arr + 3);
    for (long long j = 0; j < 3; j++) cou[arr[j]]++, p.insert(arr[j]);
    S[i] = p;
    mp[{arr[0], arr[1]}].push_back(arr[2]);
    mp[{arr[0], arr[2]}].push_back(arr[1]);
    mp[{arr[1], arr[2]}].push_back(arr[0]);
  }
  long long ans[n], elem;
  for (long long i = 1; i <= n; i++) {
    if (cou[i] == 1) {
      ans[0] = i;
      elem = i;
      vis[i] = 1;
      break;
    }
  }
  bool f = 0;
  for (long long i = 0; i < n - 2; i++) {
    if (S[i].find(elem) != S[i].end()) {
      for (auto k : S[i]) {
        if (!vis[k] && cou[k] == 2) {
          ans[1] = k;
          vis[k] = 1;
          f = 1;
          break;
        }
      }
    }
    if (f) break;
  }
  for (long long i = 2; i < n; i++) {
    long long a = ans[i - 2], b = ans[i - 1];
    if (a > b) swap(a, b);
    for (auto k : mp[{a, b}]) {
      if (!vis[k]) {
        ans[i] = k;
        vis[k] = 1;
        break;
      }
    }
  }
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
  cout << '\n';
}
