#include <bits/stdc++.h>
using namespace std;
int q[111111][3];
vector<int> e[111111];
char c[111111];
int main() {
  int n;
  scanf("%i", &n);
  for (int i = 0; i < n - 2; i++) {
    int x, y, z;
    scanf("%i%i%i", &x, &y, &z);
    q[i][0] = x;
    q[i][1] = y;
    q[i][2] = z;
    e[x].push_back(i);
    e[y].push_back(i);
    e[z].push_back(i);
  }
  int fi = 0;
  vector<int> se;
  for (int i = 1; i <= n; i++) {
    if (e[i].size() == 1) {
      fi = i;
    } else if (e[i].size() == 2) {
      se.push_back(i);
    }
  }
  int si = -1;
  for (int i = 0; i < 3; i++) {
    if (e[q[e[fi][0]][i]].size() == 2) si = q[e[fi][0]][i];
  }
  printf("%i %i ", fi, si);
  c[fi] = 1;
  c[si] = 1;
  for (int i = 0; i < n - 2; i++) {
    int ti = -1;
    for (auto x : e[si]) {
      int ti2 = -1;
      int s = 0;
      for (int i = 0; i < 3; i++) {
        if (q[x][i] == fi) {
          s++;
        }
        if (q[x][i] == si) {
          s++;
        }
        if (!c[q[x][i]]) {
          ti2 = q[x][i];
        }
      }
      if (s == 2 && ti2 != -1) {
        ti = ti2;
        break;
      }
    }
    fi = si;
    si = ti;
    c[ti] = 1;
    printf("%i ", ti);
  }
}
