#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int ar[n][3], i, j;
  vector<vector<pair<long long int, long long int> > > v(n + 1);
  vector<long long int> ans;
  map<long long int, long long int> mp;
  set<long long int> s;
  map<long long int, long long int>::iterator it;
  for (long long int i = 0; i < n - 2; i++) {
    cin >> ar[i][0] >> ar[i][1] >> ar[i][2];
    v[ar[i][0]].push_back(make_pair(ar[i][1], ar[i][2]));
    v[ar[i][1]].push_back(make_pair(ar[i][0], ar[i][2]));
    v[ar[i][2]].push_back(make_pair(ar[i][0], ar[i][1]));
    mp[ar[i][0]]++;
    mp[ar[i][1]]++;
    mp[ar[i][2]]++;
  }
  for (it = mp.begin(); it != mp.end(); it++)
    if (it->second == 1) break;
  for (i = 0; i < n; i++)
    if (ar[i][0] == it->first || ar[i][1] == it->first || ar[i][2] == it->first)
      break;
  ans.push_back(it->first);
  if (mp[ar[i][0]] == 2)
    ans.push_back(ar[i][0]);
  else if (mp[ar[i][1]] == 2)
    ans.push_back(ar[i][1]);
  else if (mp[ar[i][2]] == 2)
    ans.push_back(ar[i][2]);
  if (mp[ar[i][0]] == 3)
    ans.push_back(ar[i][0]);
  else if (mp[ar[i][1]] == 3)
    ans.push_back(ar[i][1]);
  else if (mp[ar[i][2]] == 3)
    ans.push_back(ar[i][2]);
  for (long long int i = 0; i < 3; i++) s.insert(ans[i]);
  for (i = 3; i < n; i++) {
    for (j = 0; j < v[ans[i - 1]].size(); j++)
      if (s.find(v[ans[i - 1]][j].first) != s.end() &&
          s.find(v[ans[i - 1]][j].second) == s.end()) {
        ans.push_back(v[ans[i - 1]][j].second);
        break;
      } else if (s.find(v[ans[i - 1]][j].second) != s.end() &&
                 s.find(v[ans[i - 1]][j].first) == s.end()) {
        ans.push_back(v[ans[i - 1]][j].first);
        break;
      }
    s.insert(ans[i]);
  }
  for (long long int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
