#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N = 2e5 + 5;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  map<long long, long long> m, m2;
  set<set<long long>> s;
  map<pair<long long, long long>, pair<long long, long long>> m1;
  long long ans[n];
  for (long long i = 0; i < n - 2; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    m[a]++;
    m[b]++;
    m[c]++;
    set<long long> cur = {a, b, c};
    if (a < b) {
      if (m1[{a, b}].first == 0)
        m1[{a, b}] = {c, 0};
      else
        m1[{a, b}] = {m1[{a, b}].first, c};
    } else {
      if (m1[{b, a}].first == 0)
        m1[{b, a}] = {c, 0};
      else
        m1[{b, a}] = {m1[{b, a}].first, c};
    }
    if (b < c) {
      if (m1[{b, c}].first == 0)
        m1[{b, c}] = {a, 0};
      else
        m1[{b, c}] = {m1[{b, c}].first, a};
    } else {
      if (m1[{c, b}].first == 0)
        m1[{c, b}] = {a, 0};
      else
        m1[{c, b}] = {m1[{c, b}].first, a};
    }
    if (a < c) {
      if (m1[{a, c}].first == 0)
        m1[{a, c}] = {b, 0};
      else
        m1[{a, c}] = {m1[{a, c}].first, b};
    } else {
      if (m1[{c, a}].first == 0)
        m1[{c, a}] = {b, 0};
      else
        m1[{c, a}] = {m1[{c, a}].first, b};
    }
    s.insert(cur);
  }
  long long ch = 0;
  for (auto x : s) {
    for (auto e : x) {
      if (m[e] == 1) {
        if (ch == 0) {
          for (auto val : x) {
            if (m[val] == 1) {
              ans[0] = val;
              m2[val] = 1;
            } else if (m[val] == 2) {
              ans[1] = val;
              m2[val] = 1;
            } else {
              ans[2] = val;
              m2[val] = 1;
            }
          }
          ch = 1;
        } else {
          for (auto val : x) {
            if (m[val] == 1) {
              ans[n - 1] = val;
              m2[val] = 1;
            } else if (m[val] == 2) {
              ans[n - 2] = val;
              m2[val] = 1;
            } else {
              ans[n - 3] = val;
              m2[val] = 1;
            }
          }
        }
        break;
      }
    }
  }
  for (long long i = 3; i < n - 3; i++) {
    long long a = ans[i - 2], b = ans[i - 1];
    if (a < b) {
      long long x = m1[{a, b}].first, y = m1[{a, b}].second;
      if (m2[x] == 0) {
        ans[i] = x;
        m2[x] = 1;
      } else {
        ans[i] = y;
        m2[y] = 1;
      }
    } else {
      long long x = m1[{b, a}].first, y = m1[{b, a}].second;
      if (m2[x] == 0) {
        ans[i] = x;
        m2[x] = 1;
      } else {
        ans[i] = y;
        m2[y] = 1;
      }
    }
  }
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
}
