eolymp
bolt
Try our new interface for solving problems

Bell

Time limit 1 second
Memory limit 128 MiB

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 data

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

Output data

Print in one line the array elements.

Examples

Input example #1
5
1 2 3 4 5
Output example #1
1 3 5 4 2