#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int inf = 0x3f3f3f3f;
int a[MAXN][5];
int vis[MAXN];
int ans[MAXN];
int flag[MAXN];
std::vector<int> v[MAXN];
int main() {
  memset(flag, 0, sizeof flag);
  memset(vis, 0, sizeof vis);
  int n;
  cin >> n;
  for (int i = 1; i <= n - 2; i++) {
    cin >> a[i][1] >> a[i][2] >> a[i][3];
    vis[a[i][1]]++;
    vis[a[i][2]]++;
    vis[a[i][3]]++;
    v[a[i][1]].push_back(i);
    v[a[i][2]].push_back(i);
    v[a[i][3]].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 1) {
      int pos = v[i][0];
      ans[1] = i;
      flag[i] = 1;
      for (int j = 1; j <= 3; j++) {
        if (vis[a[pos][j]] == 2) {
          ans[2] = a[pos][j];
          flag[ans[2]] = 1;
        } else if (vis[a[pos][j]] == 3) {
          ans[3] = a[pos][j];
          flag[ans[3]] = 1;
        }
      }
      break;
    }
  }
  for (int i = 4; i <= n; i++) {
    int k1 = ans[i - 1];
    int k2 = ans[i - 2];
    for (int j = 0; j < v[k1].size(); j++) {
      int pos = v[k1][j];
      if (a[pos][1] == k1 && a[pos][2] == k2 && flag[a[pos][3]] == 0) {
        ans[i] = a[pos][3];
        flag[ans[i]] = 1;
        break;
      } else if (a[pos][1] == k1 && a[pos][3] == k2 && flag[a[pos][2]] == 0) {
        ans[i] = a[pos][2];
        flag[ans[i]] = 1;
        break;
      } else if (a[pos][2] == k1 && a[pos][1] == k2 && flag[a[pos][3]] == 0) {
        ans[i] = a[pos][3];
        flag[ans[i]] = 1;
        break;
      } else if (a[pos][2] == k1 && a[pos][3] == k2 && flag[a[pos][1]] == 0) {
        ans[i] = a[pos][1];
        flag[ans[i]] = 1;
        break;
      } else if (a[pos][3] == k1 && a[pos][2] == k2 && flag[a[pos][1]] == 0) {
        ans[i] = a[pos][1];
        flag[ans[i]] = 1;
        break;
      } else if (a[pos][3] == k1 && a[pos][1] == k2 && flag[a[pos][2]] == 0) {
        ans[i] = a[pos][2];
        flag[ans[i]] = 1;
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
}
