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
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.
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 any permutation of the given heights a_1,a_2,\dots,a_n that satisfies a_1 < a_2 > a_3 < a_4 > \dots
In the first example, the permutation 1,5,3,4,2 yields 1<5>3<4>2.
In the second example, the permutation 2, 4, 1, 3 satisfies a_1<a_2>a_3<a_4.
Example 1
Example 2