#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 5;
int book[Max];
int first[Max];
int nex[Max];
int lst[Max][3];
struct node {
  int a1, b1, c1;
};
int ls[Max][3];
int l[Max];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int m;
  map<int, int> ma;
  for (int i = 1; i <= n - 2; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    if (!lst[a][0])
      lst[a][0] = i;
    else if (!lst[a][1])
      lst[a][1] = i;
    else if (!lst[a][2])
      lst[a][2] = i;
    if (!lst[b][0])
      lst[b][0] = i;
    else if (!lst[b][1])
      lst[b][1] = i;
    else if (!lst[b][2])
      lst[b][2] = i;
    if (!lst[c][0])
      lst[c][0] = i;
    else if (!lst[c][1])
      lst[c][1] = i;
    else if (!lst[c][2])
      lst[c][2] = i;
    ls[i][0] = a;
    ls[i][1] = b;
    ls[i][2] = c;
    ma[a]++;
    ma[b]++;
    ma[c]++;
  }
  int k;
  for (int i = 1; i <= n; i++) {
    if (lst[i][1] == 0) {
      k = i;
      break;
    }
  }
  l[1] = k;
  int h = 1, d = lst[k][0];
  int b, c;
  for (int i = 0; i <= 2; i++) {
    if (lst[ls[d][i]][1] != 0) {
      if (lst[ls[d][i]][2] != 0)
        c = ls[d][i];
      else
        b = ls[d][i];
    }
  }
  l[++h] = b;
  while (h + 1 <= n) {
    l[++h] = c;
    for (int i = 0; i <= 2; i++) {
      if (lst[c][i] == d) lst[c][i] = 0;
    }
    for (int i = 0; i <= 2; i++)
      if (lst[b][i] != 0 && lst[b][i] != d) {
        d = lst[b][i];
        break;
      }
    for (int i = 0; i <= 2; i++)
      if (ls[d][i] != b && ls[d][i] != c) {
        b = c;
        c = ls[d][i];
        break;
      }
  }
  for (int i = 1; i <= n; i++) cout << l[i] << " ";
}
