#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000 + 10;
int triple[MAXN][3];
int pos[MAXN][3], cnt[MAXN];
int vis[MAXN];
int ori[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  memset(triple, 0, sizeof(triple));
  memset(pos, 0, sizeof(pos));
  memset(cnt, 0, sizeof(cnt));
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n - 2; ++i) {
    for (int j = 0; j < 3; ++j) {
      scanf("%d", &triple[i][j]);
      int x = triple[i][j];
      pos[x][cnt[x]] = i;
      ++cnt[x];
    }
  }
  for (int i = 1; i <= n; ++i) ori[i] = cnt[i];
  int a = -1;
  int last = -1;
  for (int i = 1; i <= n; ++i)
    if (cnt[i] == 1) {
      a = i;
      break;
    }
  for (int i = 1; i <= n; ++i)
    if (cnt[i] == 1 && i != a) {
      last = i;
      break;
    }
  printf("%d ", a);
  vis[a] = 1;
  for (int i = 2; i <= n - 2; ++i) {
    --cnt[a];
    int tri = 0;
    for (int j = 0; j < 3; ++j)
      if (pos[a][j] != 0) {
        tri = pos[a][j];
        pos[a][j] = 0;
        break;
      }
    int nxt = -1;
    for (int j = 0; j < 3; ++j) {
      int num = triple[tri][j];
      if (num == a) {
        continue;
      } else {
        --cnt[num];
        for (int k = 0; k < 3; ++k)
          if (pos[num][k] == tri) pos[num][k] = 0;
        if (cnt[num] == 1 && (i == 2 || ori[num] == 3)) nxt = num;
      }
    }
    a = nxt;
    printf("%d ", a);
    vis[a] = 1;
  }
  for (int i = 1; i <= n; ++i)
    if (vis[i] == 0 && i != last) {
      printf("%d ", i);
      break;
    }
  printf("%d\n", last);
  return 0;
}
