#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int inf = 0x3f3f3f3f;
const long long INF = 1e18;
const int maxn = 100000 + 100;
const int maxm = 200000 + 10;
const int mod = 1000;
int gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline long long read() {
  char ch = getchar();
  long long x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long sum[maxn];
struct node {
  int b, c;
} p;
int res[maxn];
vector<node> v[maxn];
int n, ans[maxn];
int main() {
  n = read();
  for (int i = 1; i <= n - 2; ++i) {
    int a, b, c;
    a = read(), b = read(), c = read();
    sum[i] = sum[i - 1] + a + b + c;
    p.b = b, p.c = c, v[a].push_back(p);
    p.b = a, p.c = c, v[b].push_back(p);
    p.b = a, p.c = b, v[c].push_back(p);
    res[a]++, res[b]++, res[c]++;
  }
  int pos, pre;
  for (int i = 1; i <= n; ++i)
    if (res[i] == 1) pos = i;
  ans[1] = pos;
  res[pos] = 0;
  if (res[v[pos][0].b] == 2)
    pre = v[pos][0].b, ans[2] = pre, res[pre] = 0, pos = v[pos][0].c;
  else
    ans[2] = v[pos][0].c, pre = v[pos][0].c, res[pre] = 0, pos = v[pos][0].b;
  res[pos] = 0;
  ans[3] = pos;
  for (int i = 4; i <= n; ++i) {
    for (int j = 0; j < v[pos].size(); ++j) {
      node now = v[pos][j];
      if (now.b == pre && res[now.c] != 0) {
        ans[i] = now.c;
        res[now.c] = 0;
        pre = pos;
        pos = now.c;
        break;
      } else if (now.c == pre && res[now.b] != 0) {
        ans[i] = now.b;
        res[now.b] = 0;
        pre = pos;
        pos = now.b;
        break;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (i != 1) printf(" ");
    printf("%d", ans[i]);
  }
}
