#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
int n, m, t, q;
vector<int> G[N];
map<int, int> M;
set<int> S;
struct p {
  int x, y, z;
} a[N];
int vis[N], in[N], iinn[N];
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n - 2); i++) {
    scanf("%d%d%d", &a[i].x, &a[i].y, &a[i].z);
    in[a[i].x]++;
    in[a[i].y]++;
    in[a[i].z]++;
    G[a[i].x].push_back(i);
    G[a[i].y].push_back(i);
    G[a[i].z].push_back(i);
  }
  int top = -1, tail = -1;
  for (int i = (1); i <= (n); i++) {
    iinn[i] = in[i];
    if (in[i] == 1 && top == -1) {
      top = i;
      continue;
    }
    if (in[i] == 1 && top != -1) {
      tail = i;
    }
  }
  while (1) {
    printf("%d ", top);
    int sz = G[top].size();
    for (int i = (0); i <= (sz - 1); i++) {
      int id = G[top][i];
      if (vis[id]) continue;
      in[a[id].x]--;
      in[a[id].y]--;
      in[a[id].z]--;
      if (in[a[id].x] == 0 && in[a[id].y] == 0 && in[a[id].z] == 0) {
        if (a[id].x != top && a[id].x != tail) printf("%d ", a[id].x);
        if (a[id].y != top && a[id].y != tail) printf("%d ", a[id].y);
        if (a[id].z != top && a[id].z != tail) printf("%d ", a[id].z);
        printf("%d\n", tail);
        return 0;
      }
      if (in[a[id].x] == 1) top = a[id].x;
      if (in[a[id].y] == 1) top = a[id].y;
      if (in[a[id].z] == 1) top = a[id].z;
      if (in[a[id].x] + in[a[id].y] + in[a[id].z] == 2) {
        if (iinn[a[id].x] == 3 && in[a[id].x] == 1) top = a[id].x;
        if (iinn[a[id].y] == 3 && in[a[id].y] == 1) top = a[id].y;
        if (iinn[a[id].z] == 3 && in[a[id].z] == 1) top = a[id].z;
      }
      vis[id] = 1;
      break;
    }
  }
  return 0;
}
