#include <bits/stdc++.h>
using namespace std;
template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (T& x : v) is >> x;
  return is;
}
const int dr[]{-1, -1, 0, 1, 1, 1, 0, -1};
const int dc[]{0, 1, 1, 1, 0, -1, -1, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, freq[100005];
  cin >> n;
  memset(freq, 0, sizeof(freq));
  map<pair<int, int>, set<int>> mp;
  for (int i = 0; i < n - 2; ++i) {
    int x, y, z;
    cin >> x >> y >> z;
    mp[{min(x, y), max(x, y)}].insert(z);
    mp[{min(x, z), max(x, z)}].insert(y);
    mp[{min(y, z), max(y, z)}].insert(x);
    freq[x]++;
    freq[y]++;
    freq[z]++;
  }
  int f = -1, s = -1, pp = -1;
  for (int i = 1; i <= n; ++i) {
    if (freq[i] == 1) {
      f = i;
      break;
    }
  }
  for (int i = n; i >= 1; --i) {
    if (freq[i] == 2 && !mp[{min(f, i), max(f, i)}].empty()) {
      s = i;
      break;
    }
  }
  cout << f << " " << s << " ";
  for (int i = 0; i < n - 2; ++i) {
    auto st = mp[{min(f, s), max(f, s)}];
    st.erase(pp);
    int val = *st.begin();
    cout << val << " ";
    st.erase(st.begin());
    pp = f;
    f = s;
    s = val;
  }
  return 0;
}
