#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
long long mod1 = 1e9 + 7;
const int N = 1e5 + 10;
int n, a;
int ans[N], v[N], vis[N];
map<pair<long long, long long>, vector<int> > m;
void solve() {
  cin >> n;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n - 2; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    a--, b--, c--;
    m[make_pair(a, b)].push_back(c);
    m[make_pair(a, c)].push_back(b);
    m[make_pair(b, c)].push_back(a);
    m[make_pair(b, a)].push_back(c);
    m[make_pair(c, a)].push_back(b);
    m[make_pair(c, b)].push_back(a);
    v[a]++, v[b]++, v[c]++;
  }
  for (int i = 0; i < n; i++)
    if (v[i] == 1) ans[0] = i;
  for (int i = 0; i < n; i++)
    if (v[i] == 2 && m.find(make_pair(i, ans[0])) != m.end()) ans[1] = i;
  vis[ans[0]] = 1;
  vis[ans[1]] = 1;
  for (int i = 2; i < n; i++) {
    pair<long long, long long> x = make_pair(ans[i - 1], ans[i - 2]);
    for (int j = 0; j < m[x].size(); j++)
      if (!vis[m[x][j]]) {
        vis[m[x][j]] = 1;
        ans[i] = m[x][j];
        break;
      }
  }
  for (int i = 0; i < n; i++) cout << ans[i] + 1 << " ";
}
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
