#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 1e5 + 5;
struct node {
  int x, y, z;
};
vector<node> num[maxn];
int cnt[maxn];
vector<int> ans;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 2; i++) {
    node t;
    cin >> t.x >> t.y >> t.z;
    cnt[t.x]++;
    cnt[t.y]++;
    cnt[t.z]++;
    num[t.x].push_back(t);
    num[t.y].push_back(t);
    num[t.z].push_back(t);
  }
  int p = 0;
  for (int i = 1; i <= n; i++)
    if (cnt[i] == 1) {
      p = i;
      break;
    }
  for (int i = p + 1; i <= n; i++) {
    if (cnt[i] == 1) {
      node t = num[i][0];
      cnt[i] += 2;
      if (cnt[t.x] == 2) cnt[t.x]++;
      if (cnt[t.y] == 2) cnt[t.y]++;
      if (cnt[t.z] == 2) cnt[t.z]++;
      break;
    }
  }
  while (ans.size() < n - 1) {
    ans.push_back(p);
    for (node t : num[p]) {
      if (cnt[t.x] != 0 && cnt[t.y] != 0 && cnt[t.z] != 0) {
        cnt[t.x]--;
        cnt[t.y]--;
        cnt[t.z]--;
        if (cnt[t.x] == 1)
          p = t.x;
        else if (cnt[t.y] == 1)
          p = t.y;
        else if (cnt[t.z] == 1)
          p = t.z;
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (cnt[i] == 2) {
      ans.push_back(i);
      break;
    }
  for (int i : ans) cout << i << " ";
  return 0;
}
