def main():
    n = int(input())
    numbers = list(map(int, input().split()))
    numbers.sort()
    i = 0
    limit = n**2 - n
    anserw = []
    while i < limit and i<n**2-1:
        if numbers[i] != numbers[i+1]:
            anserw.append(numbers[i])
            limit += 1
            i -= 1
        elif numbers[i] != numbers[i-1] and i !=0 and numbers[i] != numbers[i+2]:
                anserw.append(numbers[i])
                anserw.append(numbers[i+1])
                limit += 2
        i += 2
    anserw += numbers[limit:]
    for x in anserw:
        print(x, end=" ")
main()
