#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
int siz[maxn];
vector<int> ve[maxn];
struct Node {
  int x, y, z;
} node[maxn];
int vism[maxn];
int vis[maxn], n, ans[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 2; i++) {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    siz[a]++;
    siz[b]++;
    siz[c]++;
    ve[a].push_back(i);
    ve[b].push_back(i);
    ve[c].push_back(i);
    node[i] = {a, b, c};
  }
  for (int i = 1; i <= n; i++) {
    if (siz[i] == 1) {
      int v = ve[i][0];
      int a = node[v].x;
      int b = node[v].y;
      int c = node[v].z;
      vism[v] = 1;
      if (siz[b] < siz[a]) swap(a, b);
      if (siz[c] < siz[a]) swap(a, c);
      if (siz[c] < siz[b]) swap(b, c);
      vis[a] = vis[b] = vis[c] = 1;
      ans[1] = a, ans[2] = b, ans[3] = c;
      break;
    }
  }
  for (int i = 2; i <= n - 2; i++) {
    int x = ans[i];
    for (int j = 0; j < ve[x].size(); j++) {
      int v = ve[x][j];
      if (vism[v]) continue;
      vism[v] = 1;
      Node now = node[v];
      if (vis[now.x] == 0) vis[now.x] = 1, ans[i + 2] = now.x;
      if (vis[now.y] == 0) vis[now.y] = 1, ans[i + 2] = now.y;
      if (vis[now.z] == 0) vis[now.z] = 1, ans[i + 2] = now.z;
      break;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d%c", ans[i], " \n"[i == n]);
  return 0;
}
