Lonely Dreamoon 2

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Dreamoon, who doesn't have a girlfriend, often goes for a walk along some streets in Taipei while thinking about problems from algorithm competitions. Unfortunately, there are so many couples acting lovey-dovey on the street that Dreamoon can not focus on thinking about those problems.

One day, despite the love birds everywhere, Dreamoon discovered a problem input containing an integer sequence: a_1,a_2,a_3,,a_Na\_1, a\_2, a\_3, \ldots, a\_N.

Dreamoon thought: because I'm single, every pair of consecutive numbers should have a large difference! This is, Dreamoon wants to reorder the sequence to make the value min_i=2N(a_ia_i1)\min\limits\_{i = 2 \ldots N}(|a\_i - a\_{i-1}|) as large as possible.

So Dreamoon turned on Drazil, who does have a girlfriend, and forced Drazil to fulfill the above condition by reordering the integer sequence. Please help poor Drazil >_<>\\\_<

입력

The input consists of two lines. The first line contains an integer NN. The second line consists of NN integers a_1,a_2,,a_Na\_1, a\_2, \ldots, a\_N.

출력

Output a single line consisting of NN integers, denoting the integer sequence aa after reordering. For this reordering, the value min_i=2Na_ia_i1\min\limits\_{i = 2 \ldots N}{|a\_i - a\_{i-1}|} must be the largest possible among all reorderings of the input sequence. If there are several possible answers, output any one of them.

제한

  • 2N2×1052 \le N \le 2 \times 10^5
  • 109a_i109-10^9 \le a\_i \le 10^9