#include <bits/stdc++.h>
using namespace std;
int n;
int num[100005];
int tx[100005];
int rep[100005][10];
int flag = 0, flag2 = 0;
int a, b, c;
bool check(int x, int y) {
  if (x == 0 || y == 0) return false;
  for (int i = 1; i <= tx[x]; i++) {
    if (rep[x][i] == y) return true;
  }
  return false;
}
int st;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 2; i++) {
    scanf("%d%d%d", &a, &b, &c);
    num[a]++;
    if (!check(a, b)) rep[a][++tx[a]] = b;
    if (!check(a, c)) rep[a][++tx[a]] = c;
    num[b]++;
    if (!check(b, a)) rep[b][++tx[b]] = a;
    if (!check(b, c)) rep[b][++tx[b]] = c;
    num[c]++;
    if (!check(c, a)) rep[c][++tx[c]] = a;
    if (!check(c, b)) rep[c][++tx[c]] = b;
  }
  for (int i = 1; i <= n; i++) {
    if (num[i] == 1 && flag == 0) {
      num[i] = 3;
      flag = 1;
    } else if (num[i] == 1) {
      st = i;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (num[i] == 2 && !check(st, i)) {
      num[i] = 3;
    }
  }
  int totx = n;
  while (totx) {
    printf("%d ", st);
    totx--;
    if (!totx) {
      break;
    }
    int fx = 0;
    for (int i = 1; i <= tx[st]; i++) {
      num[rep[st][i]]--;
    }
    for (int i = 1; i <= tx[st]; i++) {
      if (num[rep[st][i]] == 1) {
        fx = rep[st][i];
      }
    }
    st = fx;
    if (fx == 0) {
      break;
    }
  }
  return 0;
}
