#include <bits/stdc++.h>
using namespace std;
int main() {
  size_t n;
  cin >> n;
  vector<vector<int> > perms(n - 2, vector<int>(3, 0));
  vector<set<int> > count(n);
  vector<int> stcount(n, 0);
  vector<bool> used(n, false);
  for (size_t i = 0; i < n - 2; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> perms[i][j];
      perms[i][j]--;
      count[perms[i][j]].insert(i);
      stcount[perms[i][j]]++;
    }
  }
  vector<int> res;
  int now = -1;
  int permnow = -1;
  for (size_t i = 0; i < n; i++) {
    if (count[i].size() == 1) {
      now = i;
      permnow = *count[i].begin();
      break;
    }
  }
  for (size_t i = 0; i < n - 2; i++) {
    res.push_back(now);
    used[now] = true;
    int nxt = -1;
    int nxtperm = -1;
    for (int j = 0; j < 3; j++) {
      count[perms[permnow][j]].erase(permnow);
      if (count[perms[permnow][j]].size() == 1 &&
          (nxt == -1 || stcount[perms[permnow][j]] > stcount[nxt])) {
        nxt = perms[permnow][j];
        nxtperm = *count[perms[permnow][j]].begin();
      }
    }
    now = nxt;
    permnow = nxtperm;
  }
  int r1 = -1, r2 = -1;
  for (int i = 0; i < n; i++) {
    if (stcount[i] == 2 && !used[i]) {
      r2 = i + 1;
    }
    if (stcount[i] == 1 && !used[i]) {
      r1 = i + 1;
    }
  }
  for (auto i : res) {
    cout << ++i << " ";
  }
  cout << r2 << " " << r1;
}
