#include <bits/stdc++.h>
using namespace std;
bool checkbitt(long long int num, int pos);
long long int setbitt(long long int num, long long int pos);
long long int resetbitt(long long int num, int pos);
map<int, vector<int> > mpp;
int arr[100000 + 100][4];
int findd(int a, int b, int p) {
  for (auto x : mpp[b]) {
    for (auto y : mpp[a]) {
      if (x == y && x != p) return x;
    }
  }
}
int solve() {
  int n;
  cin >> n;
  for (int i = 1; i <= n - 2; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> arr[i][j];
      mpp[arr[i][j]].push_back(i);
    }
  }
  int x;
  for (int i = 1; i <= n; i++) {
    if (mpp[i].size() == 1) {
      x = i;
      break;
    }
  }
  cout << x << " ";
  int p = mpp[x].back();
  int a = -1, b = -1;
  for (int i = 0; i < 3; i++) {
    if (arr[p][i] == x) continue;
    if (a == -1)
      a = arr[p][i];
    else
      b = arr[p][i];
  }
  if (mpp[a].size() > mpp[b].size()) swap(a, b);
  cout << a << " " << b << " ";
  for (int i = 1; i <= n - 3; i++) {
    p = findd(a, b, p);
    for (int j = 0; j < 3; j++) {
      if (arr[p][j] != a && arr[p][j] != b) {
        a = b;
        b = arr[p][j];
        break;
      }
    }
    cout << b << " ";
  }
  return 0;
}
int main() {
  int cs = 1;
  int cn = 1;
  while (cs--) {
    solve();
  }
}
bool checkbitt(long long int num, int pos) { return (num >> pos) & 1; }
long long int setbitt(long long int num, long long int pos) {
  return (1 << pos) | num;
}
long long int resetbitt(long long int num, int pos) {
  if (!checkbitt(num, pos))
    return num;
  else
    return (1 << pos) ^ num;
}
