#include <bits/stdc++.h>
using namespace std;
int32_t main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j;
  long long n;
  cin >> n;
  map<long long, vector<long long> > mp;
  vector<vector<long long> > list(n);
  for (i = 0; i < n - 2; i++) {
    long long x, y, z;
    cin >> x >> y >> z;
    mp[x].push_back(i);
    mp[y].push_back(i);
    mp[z].push_back(i);
    list[i].push_back(x);
    list[i].push_back(y);
    list[i].push_back(z);
  }
  long long a, b, c;
  vector<long long> ans;
  for (auto i : mp) {
    if (i.second.size() == 1) {
      a = i.first;
      ans.push_back(a);
      if (mp[list[i.second[0]][0]].size() == 2)
        b = list[i.second[0]][0];
      else if (mp[list[i.second[0]][1]].size() == 2)
        b = list[i.second[0]][1];
      else
        b = list[i.second[0]][2];
      if (list[i.second[0]][0] != a && list[i.second[0]][0] != b)
        c = list[i.second[0]][0];
      if (list[i.second[0]][1] != a && list[i.second[0]][1] != b)
        c = list[i.second[0]][1];
      if (list[i.second[0]][2] != a && list[i.second[0]][2] != b)
        c = list[i.second[0]][2];
      break;
    }
  }
  ans.push_back(b);
  ans.push_back(c);
  set<long long> used;
  used.insert(a);
  used.insert(b);
  used.insert(c);
  for (i = 0; i < n - 3; i++) {
    long long z;
    for (auto x : mp[b]) {
      set<long long> temp;
      for (auto z : list[x]) {
        if (!used.count(z)) temp.insert(z);
      }
      if (temp.size()) {
        a = b;
        b = c;
        c = *temp.begin();
        used.insert(c);
        ans.push_back(c);
        break;
      }
    }
  }
  for (auto i : ans) cout << i << " ";
  cout << "\n";
  return 0;
}
