#include <bits/stdc++.h>
using namespace std;
long long n;
unordered_map<long long, pair<long long, set<long long> > > mp;
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  cin >> n;
  long long a, b, c;
  for (long long i = 1; i <= n - 2; ++i) {
    cin >> a >> b >> c;
    ++mp[a].first;
    mp[a].second.insert(b);
    mp[a].second.insert(c);
    ++mp[b].first;
    mp[b].second.insert(a);
    mp[b].second.insert(c);
    ++mp[c].first;
    mp[c].second.insert(a);
    mp[c].second.insert(b);
  }
  vector<long long> result;
  long long curr = 0;
  for (long long i = 1; i <= n; ++i) {
    if (mp[i].first == 1) {
      curr = i;
      break;
    }
  }
  long long first_last = 1;
  while (result.size() < n - 3) {
    result.push_back(curr);
    --mp[curr].first;
    for (auto i : mp[curr].second) {
      --mp[i].first;
    }
    if (result.size() == n - 3) {
      break;
    }
    for (auto i : mp[curr].second) {
      if (mp[i].first == 1) {
        curr = i;
      }
      if (mp[i].first > 0 && i != curr) {
        first_last = i;
      }
    }
  }
  result.push_back(first_last);
  --mp[first_last].first;
  for (auto i : mp[curr].second) {
    if (mp[i].first > 0 && i != first_last) {
      result.push_back(i);
      --mp[i].first;
      break;
    }
  }
  for (auto i : mp) {
    if (i.second.first > 0) {
      result.push_back(i.first);
      break;
    }
  }
  for (long long i = 0; i < n; ++i) {
    if (i > 0) {
      cout << " ";
    }
    cout << result[i];
  }
  cout << endl;
  return 0;
}
