#include <bits/stdc++.h>
using namespace std;
vector<int> v[100005];
int color[100005], done;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 2; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    v[a].push_back(b);
    v[a].push_back(c);
    v[b].push_back(a);
    v[b].push_back(c);
    v[c].push_back(a);
    v[c].push_back(b);
  }
  int p;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() == 2) {
      p = i;
      break;
    }
  }
  int a, b;
  a = v[v[p][0]].size(), b = v[v[p][1]].size();
  int s1 = 0, s2 = 0;
  if (a == 4) {
    s1 = v[p][0], s2 = v[p][1];
  } else {
    s1 = v[p][1], s2 = v[p][0];
  }
  cout << p << " ";
  queue<int> q;
  q.push(s1);
  q.push(s2);
  color[p] = 1, color[s1] = 1, color[s2] = 1;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    cout << x << " ";
    color[x] = 1;
    for (int i = 0; i < v[x].size(); i++) {
      int child = v[x][i];
      if (!color[child]) {
        q.push(child);
        color[child] = 1;
      }
    }
  }
  return 0;
}
