#include <bits/stdc++.h>
using namespace std;
long long int match(long long int curr, long long int prev, long long int inp[],
                    vector<bool> &vis) {
  long long int ans = -1;
  for (long long int i = 0; i < 3; i++) {
    if (inp[i] == curr) {
      if (inp[(i + 1) % 3] == prev && !vis[inp[(i + 2) % 3]])
        ans = inp[(i + 2) % 3];
      else if (inp[(i + 2) % 3] == prev && !vis[inp[(i + 1) % 3]])
        ans = inp[(i + 1) % 3];
    }
  }
  return ans;
}
void insertValue(long long int curr, long long int prev,
                 vector<vector<long long int>> &v, long long int inp[][3],
                 vector<bool> &vis, vector<long long int> &ans) {
  for (long long int x : v[curr]) {
    long long int add = match(curr, prev, inp[x], vis);
    if (add != -1) ans.push_back(add), vis[add] = true;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int inp[n + 1][3];
  vector<vector<long long int>> v(n + 1);
  for (long long int i = 1; i <= n - 2; i++) {
    long long int a;
    cin >> a;
    long long int b;
    cin >> b;
    long long int c;
    cin >> c;
    inp[i][0] = a;
    inp[i][1] = b;
    inp[i][2] = c;
    v[a].push_back(i);
    v[b].push_back(i);
    v[c].push_back(i);
  }
  vector<long long int> ans;
  vector<bool> vis(n + 1, false);
  for (long long int i = 1; i <= n; i++) {
    if (v[i].size() == 1) {
      ans.push_back(i);
      vis[i] = true;
      long long int m = v[i][0];
      for (long long int j = 0; j <= 2; j++) {
        if (inp[m][j] == i) continue;
        if (v[inp[m][j]].size() == 2) {
          ans.push_back(inp[m][j]);
          break;
        }
      }
      vis[ans[1]] = true;
      break;
    }
  }
  for (long long int i = 1; i <= n - 1; i++)
    insertValue(ans[i], ans[i - 1], v, inp, vis, ans);
  for (long long int x : ans) cout << x << " ";
  return 0;
}
