| Krosh Kaliningrad Contest 1 |
|---|
| Finished |
You are given an array of $$$n$$$ positive integers. You should determine is it possible to reorder it's elements in such a way that condition $$$a_1 \lt a_2 \gt a_3 \lt a_4 \gt a_5... $$$ is true. In other words, first element should be strictly less than the second, the second element should be strictly greater than the third etc. If such order exists output $$$n$$$ numbers – the resulting array. If no, just output $$$-1$$$. If there are more than one correct order output any of correct arrays.
In first line you are given number $$$n$$$, $$$1 \le n \le 10^5$$$ – number of elements in array. In the second line you are given $$$n$$$ positive integers $$$1 \le a_i \le 10^9$$$ – array itself.
Output correct order if it exists or $$$-1$$$ if no. Output elements not indices.
5 1 2 3 4 1
1 3 1 4 2
4 1 1 1 1
-1
| Name |
|---|


