#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100005], v[100005];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0), cerr.tie(0);
  ;
  int n;
  cin >> n;
  vector<int> ans(n, 0);
  for (int i = 0; i < n - 2; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    adj[i].push_back(x);
    adj[i].push_back(y);
    adj[i].push_back(z);
    v[x].push_back(i);
    v[y].push_back(i);
    v[z].push_back(i);
  }
  int l = 0, r = n - 1;
  int nxt = -1, nxt1 = -1, d = -1, ans1 = 0;
  for (int j = 0; j < 100005; j++) {
    if (v[j].size() == 1) {
      nxt = j;
      break;
    }
  }
  for (int j = 0; j < 100005; j++)
    if (v[j].size() == 1 && nxt != j) nxt1 = j;
  ans[n - 1] = nxt1;
  for (auto ele : adj[v[nxt1][0]]) {
    if (ans1 < v[ele].size()) {
      ans1 = v[ele].size();
      d = ele;
    }
  }
  for (int i = 0; i < n - 3; i++) {
    int ind = v[nxt][0];
    ans[l] = nxt;
    l++;
    for (auto ele : adj[ind]) {
      for (auto it = v[ele].begin(); it != v[ele].end(); it++) {
        if (*it == ind) {
          v[ele].erase(it);
          break;
        }
      }
      if (v[ele].size() == 1) nxt = ele;
    }
  }
  ans[l] = d;
  l++;
  for (auto j : adj[v[nxt][0]]) {
    if (j != d && j != nxt1) ans[l] = j;
  }
  for (auto u : ans) cout << u << " ";
}
