#include <bits/stdc++.h>
using namespace std;
vector<int> s[100005];
int cnt[100005];
int main() {
  int n, x, y, z;
  cin >> n;
  for (int i = 1; i <= n - 2; i++) {
    cin >> x >> y >> z;
    s[x].push_back(y);
    s[x].push_back(z);
    s[y].push_back(x);
    s[y].push_back(z);
    s[z].push_back(x);
    s[z].push_back(y);
    cnt[x]++;
    cnt[y]++;
    cnt[z]++;
  }
  int l, r, flag;
  l = 0;
  r = 0;
  for (int i = 1; i <= n; i++) {
    if (cnt[i] == 1) {
      l = i;
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (cnt[i] == 2) {
      flag = 0;
      for (auto it = s[l].begin(); it != s[l].end(); it++) {
        if (*it == i) {
          flag = 1;
        }
      }
      if (flag == 1) {
        r = i;
        break;
      }
    }
  }
  cnt[l] = 5;
  cnt[r] = 5;
  cout << l << " " << r;
  int temp;
  for (int i = 1; i < n - 1; i++) {
    temp = l;
    l = r;
    for (auto it = s[temp].begin(); it != s[temp].end(); it++) {
      if (cnt[*it] != 5) {
        r = *it;
      }
    }
    cnt[r] = 5;
    cout << " " << r;
  }
  return 0;
}
