Bell#825

Bell

1 second
128 megabytes
Easy (≈1000)

Write a program that in array of n integers put smallest element to the first place, the smallest of the remaining - to the last, the next smallest - to the second place, the next - to the second to the last place, and so on - until the middle of the array.

Input

The first line contains number n (1 ≤ n ≤ 30000). The second line contains n array elements, each is no more than 32767 by absolute value.

Output

Print in one line the array elements.

Examples

Example 1

Loading
Loading