Weird sort#698

Weird sort

1 second
64 megabytes
Easy

Given a sequence of integers a_1, a_2, \ldots, a_n, arrange its elements so that no two consecutive numbers in the resulting sequence have consecutive values. In other words, for the resulting sequence, the condition a_i + 1 \neq a_{i+1} (0 < i < n) must hold.

Input

Each test contains two lines. The first line contains an integer (1 \le n \le 50000) — the length of the sequence. The second line contains integers a_1, a_2, \ldots, a_n separated by single spaces. Each integer satisfies |a_i| \le 10^9. The last test contains n = 0 and should not be processed.

Output

For each test, output the resulting sequence in a separate line. The numbers in the output sequence should be separated by single spaces. If such a sequence does not exist, output "No solution" (without quotes).

Examples

Example 1

Loading
Loading