#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cout << x; }
void __print(long long x) { cout << x; }
void __print(double x) { cout << x; }
void __print(long double x) { cout << x; }
void __print(char x) { cout << '\'' << x << '\''; }
void __print(const string &x) { cout << '\"' << x << '\"'; }
void __print(bool x) { cout << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cout << '{';
  __print(x.first);
  cout << ',';
  __print(x.second);
  cout << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cout << '{';
  for (auto &i : x) cout << (f++ ? "," : ""), __print(i);
  cout << "}";
}
void _print() { cout << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cout << ", ";
  _print(v...);
}
map<pair<int, int>, vector<int>> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int p[n - 2][3];
  int freq[n + 1];
  fill(freq, freq + n + 1, 0);
  for (int i = 0; i < n - 2; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    freq[a]++, freq[b]++, freq[c]++;
    p[i][0] = a, p[i][1] = b, p[i][2] = c;
    mp[{a, b}].push_back(c);
    mp[{b, a}].push_back(c);
    mp[{a, c}].push_back(b);
    mp[{c, a}].push_back(b);
    mp[{c, b}].push_back(a);
    mp[{b, c}].push_back(a);
  }
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (freq[i] == 1) {
      ans.push_back(i);
      break;
    }
  }
  assert(ans.size() == 1);
  for (int i = 0; i < n - 2; i++) {
    if (p[i][0] == ans[0]) {
      if (freq[p[i][1]] == 2) {
        ans.push_back(p[i][1]);
        ans.push_back(p[i][2]);
      } else if (freq[p[i][2]] == 2) {
        ans.push_back(p[i][2]);
        ans.push_back(p[i][1]);
      }
    } else if (p[i][1] == ans[0]) {
      if (freq[p[i][0]] == 2) {
        ans.push_back(p[i][0]);
        ans.push_back(p[i][2]);
      } else if (freq[p[i][2]] == 2) {
        ans.push_back(p[i][2]);
        ans.push_back(p[i][0]);
      }
    } else if (p[i][2] == ans[0]) {
      if (freq[p[i][1]] == 2) {
        ans.push_back(p[i][1]);
        ans.push_back(p[i][0]);
      } else if (freq[p[i][0]] == 2) {
        ans.push_back(p[i][0]);
        ans.push_back(p[i][1]);
      }
    }
  }
  assert(ans.size() == 3);
  bool check[n + 1];
  fill(check, check + n + 1, 0);
  check[ans[0]] = check[ans[1]] = check[ans[2]] = 1;
  int num = 3;
  while (num < n) {
    int c = ans[num - 1], b = ans[num - 2], a = ans[num - 3];
    bool flag = false;
    for (auto x : mp[{c, b}]) {
      if (check[x] == 0) {
        check[x] = 1;
        ans.push_back(x);
        flag = 1;
        break;
      }
    }
    assert(flag == 1);
    num++;
  }
  for (auto x : ans) cout << x << " ";
  return 0;
}
