#include <bits/stdc++.h>
void pt() { std::cout << '\n'; }
template <typename T, typename... Args>
void pt(T a, Args... args) {
  std::cout << a << ' ';
  pt(args...);
}
using namespace std;
const int N = 2e5 + 5;
int n;
int q[N][3];
map<pair<int, int>, vector<int>> mp;
map<int, pair<int, int>> mp2;
int cnt[N];
int b[N];
int s, e;
bool vis[N];
bool go(int pos, int last1, int last2) {
  ;
  vis[last2] = 1;
  b[pos] = last2;
  if (pos == n) {
    if (last2 != e) return false;
    return true;
  }
  if (last1 > last2) swap(last1, last2);
  vector<int> nxt = mp[make_pair(last1, last2)];
  bool f = true, t = false;
  for (auto it : nxt) {
    ;
    if (!vis[it]) {
      f = go(pos + 1, b[pos], it);
      t = true;
    }
  };
  return (f && t);
}
void run() {
  for (int i = 1; i < n - 1; i++) {
    cin >> q[i][0] >> q[i][1] >> q[i][2];
    sort(q[i], q[i] + 3);
    mp[make_pair(q[i][0], q[i][1])].push_back(q[i][2]);
    mp[make_pair(q[i][1], q[i][2])].push_back(q[i][0]);
    mp[make_pair(q[i][0], q[i][2])].push_back(q[i][1]);
    mp2[q[i][0]] = make_pair(q[i][1], q[i][2]);
    mp2[q[i][1]] = make_pair(q[i][0], q[i][2]);
    mp2[q[i][2]] = make_pair(q[i][0], q[i][1]);
    for (int j = 0; j < 3; j++) {
      ++cnt[q[i][j]];
    }
  }
  s = -1, e;
  for (int i = 1; i <= n; i++) {
    if (cnt[i] == 1) {
      if (s == -1)
        s = i;
      else
        e = i;
    }
  };
  b[1] = s;
  vis[s] = 1;
  pair<int, int> p = mp2[s];
  int nxt1 = p.first, nxt2 = p.second;
  ;
  if (go(2, s, nxt1)) {
    for (int i = 1; i <= n; i++) cout << b[i] << " \n"[i == n];
  } else {
    memset(vis, 0, sizeof(vis));
    vis[s] = 1;
    go(2, s, nxt2);
    for (int i = 1; i <= n; i++) cout << b[i] << " \n"[i == n];
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(20);
  while (cin >> n) run();
  return 0;
}
