#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool upmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
inline bool upmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
const long double eps = 1e-11;
const long double pi = acos(-1);
const int oo = 1 << 30;
const long long loo = 1ll << 62;
const int mods = 998244353;
const int MAXN = 600005;
const int INF = 0x3f3f3f3f;
inline int read() {
  int f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
int num, d[MAXN], a[MAXN], b[MAXN], c[MAXN];
map<pair<int, int>, int> Map;
vector<int> E[MAXN], V[MAXN];
void add(int x, int y, int z) {
  if (!Map.count(make_pair(x, y)))
    Map[make_pair(x, y)] = Map[make_pair(y, x)] = ++num;
  E[Map[make_pair(x, y)]].push_back(z);
}
void solve(int x, int y, int z) {
  printf(" %d", z);
  for (auto v : E[Map[make_pair(y, z)]])
    if (v != x) {
      solve(y, z, v);
      break;
    }
}
int main() {
  int n = read();
  for (int i = 1; i <= n - 2; i++) {
    int x = read(), y = read(), z = read();
    d[x]++, d[y]++, d[z]++;
    add(x, y, z);
    add(y, z, x);
    add(z, x, y);
    a[i] = x, b[i] = y, c[i] = z;
  }
  for (int i = 1; i <= n - 2; i++) {
    V[1].clear(), V[2].clear(), V[3].clear();
    V[d[a[i]]].push_back(a[i]), V[d[b[i]]].push_back(b[i]),
        V[d[c[i]]].push_back(c[i]);
    if (V[1].size() == 1 && V[2].size() == 1 && V[3].size() == 1) {
      printf("%d %d", V[1][0], V[2][0]);
      solve(V[1][0], V[2][0], V[3][0]);
      break;
    }
  }
  return 0;
}
