import math

def main():
    n = int(input())
    numbers = list(map(int, input().split()))
    numbers.sort(reverse=True)
    to_found = n
    i = 0
    counter = 1
    if n == 1:
        print(numbers[0])
    else:
        while to_found > 0:
            while i<n**2 - 2:
                if numbers[i] == numbers[i+1]:
                    counter += 1
                    i += 1
                else:
                    break
            how_many_times = math.floor(math.sqrt(counter))
            if how_many_times < to_found:
                print((str(numbers[i]) + " ") * how_many_times, end = "")
            else:
                print((str(numbers[i]) + " ") * to_found, end= "")
            to_found -= how_many_times
            counter = 1
            i += 1
main()
