import math

N = int(input())# broj prodavnica

trouglovi = list()

for i in range(N - 4):
    trouglovi.append(list(map(int, input().split())))

mreza = dict()

mreza[1] = [2, 3]
mreza[2] = [1, 3]
mreza[3] = [1, 2]

if N >= 4:
    mreza[1].append(4)
    mreza[2].append(4)
    mreza[3].append(4)
    mreza[4] = [1, 2, 3]

for i in range(len(trouglovi)):
    trougao = trouglovi[i]
    mreza[4 + i + 1] = list(trougao)
    for tacka in trougao:
        mreza[tacka].append(4 + i + 1)

putanja = [1]

trenutno_stajaliste = 1

poseceno = list()
for i in range(N):
    poseceno.append(False)

#print(mreza)

while False in poseceno:
    poseceno[trenutno_stajaliste - 1] = True
    susedi = mreza[trenutno_stajaliste]
    min_suseda = math.inf
    index_min_suseda = -1
    for sused in susedi:
        if not poseceno[sused - 1] and len(mreza[sused]) < min_suseda:
            min_suseda = len(mreza[sused])
            index_min_suseda = sused
    putanja.append(index_min_suseda)
    trenutno_stajaliste = index_min_suseda

putanja[-1] = 1

for i in range(len(putanja)):
    if i != len(putanja) - 1:
        print(putanja[i], end=' ')
    else:
        print(putanja[i], end='')