#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  vector<set<int>> v(n + 1);
  for (int i = 0; i < n - 2; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    v[x].insert(y);
    v[x].insert(z);
    v[y].insert(x);
    v[y].insert(z);
    v[z].insert(x);
    v[z].insert(y);
  }
  vector<int> res(n);
  for (int i = 1; i < n + 1; i++) {
    if (((int)(v[i]).size()) == 2) {
      res[0] = i;
      break;
    }
  }
  vector<bool> been(n + 1);
  int num1 = res[0], num2;
  int can1 = *v[num1].begin(), can2 = *v[num1].rbegin();
  if (((int)(v[can1]).size()) == 3)
    num2 = can1;
  else
    num2 = can2;
  res[1] = num2;
  been[num1] = been[num2] = 1;
  for (int i = 2; i < n - 2; i++) {
    vector<int> can;
    for (auto& j : v[num1]) {
      if (been[j]) continue;
      can.push_back(j);
    }
    for (auto& j : v[num2]) {
      if (been[j]) continue;
      can.push_back(j);
    }
    sort(can.begin(), can.end());
    int num = 0;
    for (int j = 0; j < ((int)(can).size()) - 1; j++) {
      if (can[j] == can[j + 1]) {
        num = can[j];
        break;
      }
    }
    been[num] = 1;
    res[i] = num;
    num1 = num2;
    num2 = num;
  }
  for (int i = 1; i < n + 1; i++) {
    if (((int)(v[i]).size()) == 3 && !been[i]) {
      res[n - 2] = i;
    } else if (((int)(v[i]).size()) == 2 && !been[i]) {
      res[n - 1] = i;
    }
  }
  for (auto& i : res) cout << i << " ";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
