#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
vector<int> v[maxn];
int a[maxn][3];
int vis[maxn];
int viss[maxn];
int ans[maxn];
int a1, a2, b1, b2;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n - 2; i++) {
    cin >> a[i][0] >> a[i][1] >> a[i][2];
    vis[a[i][0]]++;
    vis[a[i][1]]++;
    vis[a[i][2]]++;
    v[a[i][0]].push_back(a[i][1]), v[a[i][0]].push_back(a[i][2]);
    v[a[i][1]].push_back(a[i][0]), v[a[i][1]].push_back(a[i][2]);
    v[a[i][2]].push_back(a[i][1]), v[a[i][2]].push_back(a[i][0]);
  }
  int cnt = 0;
  int p;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 1) {
      p = i;
      break;
    }
  }
  int q;
  if (vis[v[p][0]] == 2) {
    q = v[p][0];
  } else
    q = v[p][1];
  ans[cnt++] = p;
  ans[cnt++] = q;
  viss[p] = 1;
  viss[q] = 1;
  for (int i = 1; i <= n - 2; i++) {
    int c;
    for (int j = 0; j < v[p].size(); j++) {
      if (!viss[v[p][j]]) {
        c = v[p][j];
        break;
      }
    }
    ans[cnt++] = c;
    viss[c] = 1;
    p = q, q = c;
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
