#include <bits/stdc++.h>
using namespace std;
struct tgadata {
  int num, q[3];
} tga[100005], agt[100005];
int findnxt(int a, int b, int c) {
  for (int i = 0; i < agt[b].num; i++) {
    for (int j = 0; j < agt[c].num; j++) {
      if (agt[b].q[i] == agt[c].q[j]) {
        for (int k = 0; k < 3; k++) {
          if (tga[agt[b].q[i]].q[k] != b && tga[agt[b].q[i]].q[k] != c) {
            if (tga[agt[b].q[i]].q[k] != a) return tga[agt[b].q[i]].q[k];
            break;
          }
        }
      }
    }
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 2; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> tga[i].q[j];
      agt[tga[i].q[j]].q[agt[tga[i].q[j]].num++] = i;
    }
    tga[i].num = i;
  }
  int p1;
  for (int i = 0; i < n - 2; i++) {
    if (agt[i].num == 1) {
      p1 = i;
      break;
    }
  }
  int p2;
  for (int i = 0; i < 3; i++) {
    if (tga[agt[p1].q[0]].q[i] != p1 && agt[tga[agt[p1].q[0]].q[i]].num <= 2) {
      p2 = tga[agt[p1].q[0]].q[i];
      break;
    }
  }
  int p3;
  for (int i = 0; i < 3; i++) {
    if (tga[agt[p1].q[0]].q[i] != p1 && tga[agt[p1].q[0]].q[i] != p2) {
      p3 = tga[agt[p1].q[0]].q[i];
      break;
    }
  }
  cout << p1;
  for (int i = 0; i < n - 3; i++) {
    int tmp = findnxt(p1, p2, p3);
    p1 = p2;
    p2 = p3;
    p3 = tmp;
    cout << ' ' << p1;
  }
  cout << ' ' << p2 << ' ' << p3 << endl;
  return 0;
}
