#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
map<pair<int, int>, vector<int> > hs;
long long int f[N];
long long int x1[N], x2[N], x3[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    int n;
    cin >> n;
    int k = n - 2, gg = 1;
    while (k--) {
      int a, b, c;
      cin >> a >> b >> c;
      x1[gg] = a;
      x2[gg] = b;
      x3[gg++] = c;
      hs[make_pair(a, b)].push_back(c);
      hs[make_pair(a, c)].push_back(b);
      hs[make_pair(c, b)].push_back(a);
      hs[make_pair(b, a)].push_back(c);
      hs[make_pair(c, a)].push_back(b);
      hs[make_pair(b, c)].push_back(a);
      f[a]++;
      f[b]++;
      f[c]++;
    }
    vector<int> ans;
    for (int i = 1; i <= n; i++) {
      if (f[i] == 1) {
        ans.push_back(i);
        break;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (x1[i] == ans.back()) {
        if (f[x2[i]] == 2) {
          ans.push_back(x2[i]);
          break;
        } else if (f[x3[i]] == 2) {
          ans.push_back(x3[i]);
          break;
        }
      } else if (x2[i] == ans.back()) {
        if (f[x1[i]] == 2) {
          ans.push_back(x1[i]);
          break;
        } else if (f[x3[i]] == 2) {
          ans.push_back(x3[i]);
          break;
        }
      } else if (x3[i] == ans.back()) {
        if (f[x2[i]] == 2) {
          ans.push_back(x2[i]);
          break;
        } else if (f[x1[i]] == 2) {
          ans.push_back(x1[i]);
          break;
        }
      }
    }
    vector<int> taken(n + 1, 0);
    taken[ans[0]] = 1;
    taken[ans[1]] = 1;
    for (int i = 3; i <= n; i++) {
      int x = ans.back(), y = ans[ans.size() - 2];
      vector<int> temp = hs[make_pair(x, y)];
      for (int j = 0; j < temp.size(); j++) {
        if (taken[temp[j]] == 0) {
          taken[temp[j]] = 1;
          ans.push_back(temp[j]);
          break;
        }
      }
    }
    for (int i = 0; i < n; i++) cout << ans[i] << " ";
  }
  return 0;
}
