#include <bits/stdc++.h>
using namespace std;
const int MAXJ = 3;
int n;
vector<vector<int>> vec, ind;
vector<vector<pair<int, int>>> qwe;
vector<map<int, int>> cnt;
vector<int> answer, pbans;
set<int> use;
void in_ans(int par) {
  int last = answer[(int)answer.size() - 1];
  vector<pair<int, int>> all_pind;
  vector<pair<pair<int, int>, int>> numCNT;
  for (int i = 0; i < (int)qwe[last].size(); i++) {
    all_pind.push_back(qwe[last][i]);
    numCNT.push_back(
        {{-cnt[last][qwe[last][i].first], (int)ind[qwe[last][i].first].size()},
         qwe[last][i].first});
    numCNT.push_back({{-cnt[last][qwe[last][i].second],
                       (int)ind[qwe[last][i].second].size()},
                      qwe[last][i].second});
  }
  sort(numCNT.begin(), numCNT.end());
  for (int i = 0; i < (int)numCNT.size(); i++) {
  }
  for (int i = 0; i < (int)numCNT.size(); i++) {
    if (use.find(numCNT[i].second) == use.end()) {
      answer.push_back(numCNT[i].second);
      use.insert(numCNT[i].second);
    }
  }
}
void solve() {
  scanf("%i", &n);
  vec = ind = vector<vector<int>>(n);
  qwe = vector<vector<pair<int, int>>>(n);
  cnt = vector<map<int, int>>(n);
  for (int i = 0; i < n - 2; i++) {
    for (int j = 0; j < MAXJ; j++) {
      int num;
      scanf("%i", &num);
      --num;
      vec[i].push_back(num);
      ind[num].push_back(i);
    }
    sort(vec[i].begin(), vec[i].end());
    qwe[vec[i][0]].push_back({vec[i][1], vec[i][2]});
    cnt[vec[i][0]][vec[i][1]]++;
    cnt[vec[i][0]][vec[i][2]]++;
    qwe[vec[i][1]].push_back({vec[i][0], vec[i][2]});
    cnt[vec[i][1]][vec[i][0]]++;
    cnt[vec[i][1]][vec[i][2]]++;
    qwe[vec[i][2]].push_back({vec[i][0], vec[i][1]});
    cnt[vec[i][2]][vec[i][0]]++;
    cnt[vec[i][2]][vec[i][1]]++;
  }
  vector<int> be;
  for (int i = 0; i < n; i++) {
    if ((int)ind[i].size() == 1) {
      be.push_back(i);
    }
  }
  answer.push_back(be[0]);
  use.insert(be[0]);
  for (int i = 0; i < (n - 3) / 2; i++) {
    in_ans(0);
  }
  for (int i = (n - 3) / 2; i < n - 2 - 1; i++) {
    in_ans(1);
  }
  for (int i = 0; i < (int)answer.size(); i++) {
    printf("%i ", answer[i] + 1);
  }
}
int main() { solve(); }
