#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> G[n + 1];
  vector<int> deg(n + 1, 0);
  for (int i = 0; i < n - 2; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    G[x].push_back(y);
    G[x].push_back(z);
    G[y].push_back(x);
    G[y].push_back(z);
    G[z].push_back(x);
    G[z].push_back(y);
    deg[x]++;
    deg[y]++;
    deg[z]++;
  }
  int st = 0;
  for (int i = 1; i < n + 1; i++) {
    if (deg[i] == 1) {
      st = i;
      break;
    }
  }
  int end = 0;
  if (deg[G[st][0]] == 2)
    end = G[st][0];
  else
    end = G[st][1];
  vector<int> vis(n + 1, 0);
  vis[st] = 1;
  vis[end] = 1;
  cout << st << " " << end << " ";
  for (int i = 0; i < n - 2; i++) {
    int x;
    for (int j = 0; j < G[st].size(); j++) {
      if (!vis[G[st][j]]) {
        x = G[st][j];
        break;
      }
    }
    vis[x] = 1;
    cout << x << " ";
    st = end;
    end = x;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
