#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const int maxnn = 2e5 + 7;
int n, m;
struct dy {
  int a[4];
} sz[maxnn];
vector<int> cx[maxnn];
map<long long, vector<int>> que;
int ans[maxnn];
int s = 0, t = 0;
int ss = 0, tt = 0;
int flag = 0;
long long base = 1;
int check(int p1, int p2, int nxt) {
  for (int i = 1; i <= 3; i++) {
    if (sz[nxt].a[i] != p1 && sz[nxt].a[i] != p2) return sz[nxt].a[i];
  }
}
void bfs(int p, long long p1, long long p2, int old) {
  if (flag == 1) return;
  if (p == n) {
    if (ans[n - 1] != tt) return;
    flag = 1;
    for (int i = 0; i < n; i++) {
      if (i < n - 1)
        printf("%d ", ans[i]);
      else
        printf("%d\n", ans[i]);
    }
    return;
  }
  long long temp = p1 * base + p2;
  int nxt = -1;
  for (int i = 0; i < que[temp].size(); i++) {
    if (que[temp][i] != old) {
      nxt = que[temp][i];
      break;
    }
  }
  if (nxt == -1) return;
  int p3 = check(p1, p2, nxt);
  ans[p] = p3;
  bfs(p + 1, p2, p3, nxt);
}
int main() {
  scanf("%d", &n);
  int tttt = n;
  while (tttt) {
    base++;
    tttt /= 10;
  }
  base = (long long)pow(10, base);
  for (int i = 1; i <= n - 2; i++) {
    scanf("%d %d %d", &sz[i].a[1], &sz[i].a[2], &sz[i].a[3]);
    sort(sz[i].a + 1, sz[i].a + 4);
    cx[sz[i].a[1]].push_back(i);
    cx[sz[i].a[2]].push_back(i);
    cx[sz[i].a[3]].push_back(i);
    for (int j = 1; j <= 3; j++) {
      long long temp = (long long)sz[i].a[j];
      for (int k = 1; k <= 3; k++) {
        if (k != j) {
          que[(long long)temp * base + (long long)sz[i].a[k]].push_back(i);
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (cx[i].size() == 1) {
      if (s == 0) {
        s = cx[i][0];
        ss = i;
      } else if (t == 0) {
        t = cx[i][0];
        tt = i;
      }
    }
  }
  int p1 = 0, p2 = 0;
  for (int i = 1; i <= 3; i++) {
    if (sz[s].a[i] != ss) {
      if (p1 == 0)
        p1 = sz[s].a[i];
      else
        p2 = sz[s].a[i];
    }
  }
  ans[0] = ss;
  ans[1] = p1;
  ans[2] = p2;
  bfs(3, (long long)p1, (long long)p2, s);
  if (flag == 0) {
    ans[1] = p2;
    ans[2] = p1;
    bfs(3, (long long)p2, (long long)p1, s);
  }
  return 0;
}
