#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> g[N];
bool visit[N];
int f[N], x[N], y[N], z[N];
vector<int> ans;
bool check(int a, int b, int c) {
  vector<pair<int, int> > p;
  p.push_back({f[a], a});
  p.push_back({f[b], b});
  p.push_back({f[c], c});
  sort(p.begin(), p.end());
  if (p[0].first == 1 && p[1].first == 2 && p[2].first == 3) return true;
  return false;
}
void dfs(int u) {
  ans.push_back(u);
  int s = ans.size();
  for (auto v : g[u])
    if (visit[v] == false &&
        binary_search(g[v].begin(), g[v].end(), ans[s - 1]) &&
        binary_search(g[v].begin(), g[v].end(), ans[s - 2])) {
      visit[v] = true;
      dfs(v);
    }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int n, a, b, c;
  cin >> n;
  for (int i = 1; i <= n - 2; i++) {
    cin >> a >> b >> c;
    f[a]++;
    f[b]++;
    f[c]++;
    x[i] = a;
    y[i] = b;
    z[i] = c;
    g[a].push_back(b), g[a].push_back(c);
    g[b].push_back(a), g[b].push_back(c);
    g[c].push_back(b), g[c].push_back(a);
  }
  for (int i = 1; i <= n; i++) sort(g[i].begin(), g[i].end());
  for (int i = 1; i <= n - 2; i++) {
    if (check(x[i], y[i], z[i])) {
      vector<pair<int, int> > p;
      a = x[i], b = y[i], c = z[i];
      p.push_back({f[a], a});
      p.push_back({f[b], b});
      p.push_back({f[c], c});
      sort(p.begin(), p.end());
      ans.push_back(p[0].second);
      ans.push_back(p[1].second);
      visit[a] = visit[b] = visit[c] = true;
      dfs(p[2].second);
      break;
    }
  }
  for (auto x : ans) cout << x << " ";
  cout << endl;
  return 0;
}
