Super-rocky Terrain#11842

Super-rocky Terrain

1 second
256 megabytes
Easy

Master Shifu, in preparation for the next training of the Dragon Warrior, seeks a rocky terrain. An ordinary rocky terrain is too easy a trial---he requires a super-rocky terrain. A sequence of consecutive mountains is called super-rocky if their heights a_i satisfy

a_1 < a_2 > a_3 < a_4 > a_5 < \dots

that is, every mountain at an even index is higher than its two neighbors, and every mountain at an odd index is lower than its two neighbors.

It turned out that mountain heights form a permutation of the integers from to . Determine how the mountains should be arranged to make it a super-rocky terrain.

Input

The first line contains a single integer (1 \le n \le 2\times 10^5), the number of mountains.

The second line contains distinct integers forming a permutation of \{1,2,\dots,n\}.

Output

Output any permutation of the given heights a_1,a_2,\dots,a_n that satisfies a_1 < a_2 > a_3 < a_4 > \dots

Note

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading