402182: GYM100687 H Graduation Projects (B)

Memory Limit:64 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Graduation Projects (B)time limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output

The imbalance value of last year was too large. Therefore, Dr. Saqr asked you to implement a program that produces a teams formation with the minimum possible imbalance value.

Input

The first line of input contains an integer N (1 ≤ N ≤ 50) representing the number of teams.

The second line contains 2N space-separated integers; each representing the grade of one student.

Output

Print the 2N integers, such that if every two consecutive students formed a team, the imbalance value would be the minimum possible.

If there is more than one possible solution, print any of them.

ExamplesInput
2
23 36 28 8
Output
8 36 23 28
Input
3
26 48 16 24 9 8
Output
8 48 9 26 16 24

加入题单

上一题 下一题 算法标签: