#include <bits/stdc++.h>
using namespace std;
struct qq {
  int a, b, c;
};
int t, n;
qq f[100012];
map<pair<int, int>, vector<int> > m;
map<int, int> mym;
void kaisa() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n - 2; i++) {
    cin >> f[i].a >> f[i].b >> f[i].c;
    m[{f[i].a, f[i].b}].push_back(f[i].c);
    m[{f[i].b, f[i].a}].push_back(f[i].c);
    m[{f[i].b, f[i].c}].push_back(f[i].a);
    m[{f[i].c, f[i].b}].push_back(f[i].a);
    m[{f[i].a, f[i].c}].push_back(f[i].b);
    m[{f[i].c, f[i].a}].push_back(f[i].b);
    mym[f[i].a]++;
    mym[f[i].b]++;
    mym[f[i].c]++;
  }
  int fii, see;
  for (int i = 1; i <= n - 2; i++) {
    if (mym[f[i].a] == 1 && mym[f[i].b] == 2) {
      fii = f[i].a;
      see = f[i].b;
      break;
    }
    if (mym[f[i].b] == 1 && mym[f[i].a] == 2) {
      fii = f[i].b;
      see = f[i].a;
      break;
    }
    if (mym[f[i].b] == 1 && mym[f[i].c] == 2) {
      fii = f[i].b;
      see = f[i].c;
      break;
    }
    if (mym[f[i].c] == 1 && mym[f[i].b] == 2) {
      fii = f[i].c;
      see = f[i].b;
      break;
    }
    if (mym[f[i].a] == 1 && mym[f[i].c] == 2) {
      fii = f[i].a;
      see = f[i].c;
      break;
    }
    if (mym[f[i].c] == 1 && mym[f[i].a] == 2) {
      fii = f[i].c;
      see = f[i].a;
      break;
    }
  }
  int pre = 0;
  cout << fii << " " << see << " ";
  while (mym[see] != 1) {
    int temp = -1;
    for (int tam : m[{fii, see}]) {
      if (tam != pre) {
        temp = tam;
        break;
      }
    }
    if (temp == -1) break;
    pre = fii;
    fii = see;
    see = temp;
    cout << temp << " ";
  }
}
int main() {
  kaisa();
  return 0;
}
