eolymp
bolt
Try our new interface for solving problems
Problems

Sorting

Sorting

Given a sequence of 32 bit signed integers. Sort this sequence, and remove all repeating elements, i.e. remove all but one copy of each number in the sequence.

Input

The first line contains amount of numbers n (1n65536) in the sequence. The next n lines contain n integers (one number per line).

Output

Write no more than n numbers, sorted in descending order if n is even, and in ascending order if n is odd. Each number must appear no more than once.

Time limit 1 second
Memory limit 128 MiB
Input example #1
6
8
8
7
3
7
7
Output example #1
8
7
3