#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3fLL;
const int MAXN = 1e5 + 6;
vector<int> v[MAXN];
bool vis[MAXN];
int main() {
  std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, x, y, z;
  cin >> n;
  for (int i = 0; i < n - 2; i++) {
    cin >> x >> y >> z;
    v[x].emplace_back(y);
    v[x].emplace_back(z);
    v[y].emplace_back(x);
    v[y].emplace_back(z);
    v[z].emplace_back(x);
    v[z].emplace_back(y);
  }
  for (x = 1; x <= n; x++)
    if (v[x].size() == 2) break;
  y = v[x][0];
  z = v[x][1];
  if (v[z].size() == 4) swap(y, z);
  cout << x << " " << y << " " << z << " ";
  vis[x] = vis[y] = vis[z] = true;
  for (int i = 4; i <= n; i++) {
    int len = v[y].size();
    for (int j = 0; j < len; j++) {
      if (!vis[v[y][j]]) {
        cout << v[y][j];
        if (i == n) {
          cout << '\n';
          return 0;
        } else
          cout << " ";
        vis[v[y][j]] = true;
        x = z;
        z = v[y][j];
        y = x;
        break;
      }
    }
  }
  return 0;
}
