#include <bits/stdc++.h>
using namespace std;
set<int> already;
int common(vector<int> &v1, vector<int> &v2) {
  for (int n2 : v2) {
    for (int n1 : v1) {
      if (already.find(n1) == already.end() && n1 == n2) {
        return n1;
      }
    }
  }
}
void testcase() {
  int n;
  map<int, int> freq;
  cin >> n;
  vector<vector<int>> nums(n + 5);
  int start, next;
  int q1, q2, q3;
  for (int i{0}; i < n - 2; i++) {
    cin >> q1 >> q2 >> q3;
    freq[q1]++;
    freq[q2]++;
    freq[q3]++;
    nums[q1].push_back(q2);
    nums[q1].push_back(q3);
    nums[q2].push_back(q1);
    nums[q2].push_back(q3);
    nums[q3].push_back(q1);
    nums[q3].push_back(q2);
  }
  for (int i{1}; i <= n; i++) {
    if (freq[i] == 1) {
      start = i;
      break;
    }
  }
  cout << start << " ";
  for (int x : nums[start]) {
    if (freq[x] == 2) {
      cout << x << " ";
      next = x;
      break;
    }
  }
  n -= 2;
  already.insert(start);
  already.insert(next);
  while (n--) {
    int agla = common(nums[start], nums[next]);
    cout << agla << " ";
    start = next;
    next = agla;
    already.insert(next);
  }
  cout << endl;
}
int main(int argc, char **argv) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  t = 1;
  while (t--) {
    testcase();
  }
  return 0;
}
