#include <bits/stdc++.h>
using namespace std;
vector<int> v[100005];
bool vis[100005];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, x, y, z;
  cin >> n;
  int arr[n];
  for (int i = (0); i <= (n - 3); ++i) {
    cin >> x >> y >> z;
    v[x].push_back(y);
    v[x].push_back(z);
    v[y].push_back(x);
    v[y].push_back(z);
    v[z].push_back(x);
    v[z].push_back(y);
  }
  for (int i = 1; i <= n; i++) {
    if (v[i].size() == 2) {
      arr[0] = i;
      vis[i] = 1;
      break;
    }
  }
  for (int i : v[arr[0]]) {
    if (v[i].size() == 4) {
      arr[1] = i;
      vis[i] = 1;
      break;
    }
  }
  for (int i = 2; i < n; i++) {
    for (int j : v[arr[i - 1]]) {
      for (int k : v[arr[i - 2]]) {
        if (j == k && !vis[j]) {
          arr[i] = j;
          vis[j] = 1;
        }
      }
    }
  }
  for (int x : arr) {
    cout << x << " ";
  }
  cout << '\n';
  return 0;
}
