resenje=[1, 2]
a=[]
n=int(input())
for i in range(n-4):
    a.append(input().split())

a1=sorted(list(a))
l=len(a1)

k=l//2
for i in range(k):

    for j in range(n):
        resenje.append(a1[j-2*k])
print(*resenje)