#include <bits/stdc++.h>
#pragma GCC optimize(3)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int seed = 131;
const long long LLMAX = 2e18;
const int MOD = 1e9 + 7;
const double eps = 1e-8;
const int MAXN = 1e6 + 10;
const int hmod1 = 0x48E2DCE7;
const int hmod2 = 0x60000005;
inline long long sqr(long long x) { return x * x; }
inline int sqr(int x) { return x * x; }
inline double sqr(double x) { return x * x; }
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long exgcd(long long a, long long b, long long &x, long long &y) {
  long long d;
  (b == 0 ? (x = 1, y = 0, d = a)
          : (d = exgcd(b, a % b, y, x), y -= a / b * x));
  return d;
}
long long qpow(long long a, long long n) {
  long long sum = 1;
  while (n) {
    if (n & 1) sum = sum * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return sum;
}
inline int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return (x > 0 ? 1 : -1);
}
vector<int> st[MAXN], ans;
int a[MAXN][3], num[MAXN], use[MAXN];
bool cmp(int a, int b) { return num[a] < num[b]; }
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 2; i++) {
    for (int j = 0; j < 3; j++) cin >> a[i][j];
    for (int j = 0; j < 3; j++) num[a[i][j]]++;
    for (int j = 0; j < 3; j++) st[a[i][j]].push_back(i);
  }
  for (int i = 0; i < n - 2; i++) {
    int tim[4] = {0, 0, 0, 0};
    for (int j = 0; j < 3; j++) tim[num[a[i][j]]] = 1;
    if (tim[1] && tim[2] && tim[3]) {
      sort(a[i], a[i] + 3, cmp);
      for (int j = 0; j < 3; j++) ans.push_back(a[i][j]);
      use[i] = 1;
      break;
    }
  }
  for (int i = 1; i < n - 2; i++) {
    vector<int> l, r;
    for (int j = 0; j < st[ans[i]].size(); j++) l.push_back(st[ans[i]][j]);
    for (int j = 0; j < st[ans[i + 1]].size(); j++)
      r.push_back(st[ans[i + 1]][j]);
    int f = 0;
    for (int j = 0; j < l.size() && !f; j++)
      for (int k = 0; k < r.size() && !f; k++)
        if (l[j] == r[k] && use[l[j]] == 0) {
          for (int z = 0; z < 3; z++)
            if (a[l[j]][z] != ans[i] && a[l[j]][z] != ans[i + 1]) {
              ans.push_back(a[l[j]][z]);
              use[l[j]] = 1;
              f = 1;
              break;
            }
        }
  }
  for (auto i : ans) cout << i << ' ';
  cout << endl;
  return 0;
}
