#include <bits/stdc++.h>
using namespace std;
int ara[500000 + 5], taken[500000 + 5];
vector<int> c[500000 + 5];
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  };
  int n;
  cin >> n;
  for (int i = 0; i < n - 2; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    c[x].push_back(z);
    c[y].push_back(z);
    c[x].push_back(y);
    c[z].push_back(y);
    c[z].push_back(x);
    c[y].push_back(x);
    ara[x]++;
    ara[y]++;
    ara[z]++;
  }
  for (int i = 1; i <= n; i++) {
    sort(c[i].begin(), c[i].end());
  }
  int first;
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (ara[i] == 1) {
      first = i;
      ans.push_back(first);
      taken[first] = 1;
      break;
    }
  }
  for (int i = 0; i < c[first].size(); i++) {
    int second = c[first][i];
    if (ara[second] == 2) {
      ans.push_back(second);
      taken[second] = 1;
      break;
    }
  }
  for (int i = 2; i < n; i++) {
    int l1 = ans[i - 2];
    int l = ans[i - 1];
    for (int j = 0; j < c[l].size(); j++) {
      int v = c[l][j];
      if (taken[v] == 0) {
        if (binary_search(c[l].begin(), c[l].end(), v) &&
            binary_search(c[l1].begin(), c[l1].end(), v)) {
          ans.push_back(v);
          taken[v] = 1;
          break;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << ' ';
}
