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.
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.
Print in one line the array elements.