#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100005];
bool vis[100005];
int main() {
  int n, x, y, z;
  scanf("%d", &n);
  int arr[n];
  for (int i = 0; i < n - 2; i++) {
    scanf("%d%d%d", &x, &y, &z);
    adj[x].push_back(y);
    adj[y].push_back(z);
    adj[z].push_back(x);
    adj[y].push_back(x);
    adj[z].push_back(y);
    adj[x].push_back(z);
  }
  for (int i = 1; i <= n; i++)
    if (adj[i].size() == 2) {
      arr[0] = i;
      vis[i] = 1;
      break;
    }
  for (int i : adj[arr[0]])
    if (adj[i].size() == 4) {
      arr[1] = i;
      vis[i] = 1;
      break;
    }
  for (int i = 2; i < n; i++) {
    for (int j : adj[arr[i - 1]])
      for (int k : adj[arr[i - 2]])
        if (j == k && !vis[j]) arr[i] = j, vis[j] = 1;
  }
  for (int i : arr) cout << i << " ";
  cout << endl;
  return 0;
}
