#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n - 1][4];
  map<int, vector<int>> pos;
  for (int i = 1; i <= n - 2; ++i)
    for (int j = 1; j <= 3; ++j) {
      cin >> a[i][j];
      pos[a[i][j]].push_back(i);
    }
  int x = -1, y = -1, z = -1;
  for (int i = 1; i <= n - 2 && x == -1; ++i)
    for (int j = 1; j <= 3; ++j) {
      if (pos[a[i][j]].size() == 1) {
        swap(a[i][j], a[i][1]);
        if (pos[a[i][3]].size() < pos[a[i][2]].size()) swap(a[i][2], a[i][3]);
        x = a[i][1];
        y = a[i][2];
        z = a[i][3];
        for (int k = 1; k <= 3; ++k) {
          auto it = find(pos[a[i][k]].begin(), pos[a[i][k]].end(), i);
          pos[a[i][k]].erase(it);
          if (pos[a[i][k]].size() == 0) cout << a[i][k] << " ";
        }
        break;
      }
    }
  while (true) {
    if (pos[y].size() == 0) break;
    int i = pos[y].front();
    if (a[i][2] == y) swap(a[i][1], a[i][2]);
    if (a[i][3] == y) swap(a[i][1], a[i][3]);
    if (a[i][3] == z) swap(a[i][2], a[i][3]);
    x = a[i][1];
    y = a[i][2];
    z = a[i][3];
    for (int k = 1; k <= 3; ++k) {
      auto it = find(pos[a[i][k]].begin(), pos[a[i][k]].end(), i);
      pos[a[i][k]].erase(it);
      if (pos[a[i][k]].size() == 0) cout << a[i][k] << " ";
    }
  }
  cout << "\n";
  return 0;
}
