Problem 1610. -- zp‘s watermelon

1610: zp‘s watermelon

Time Limit: 1 Sec  Memory Limit: 128 MB   64bit IO Format: %lld
Submitted: 42  Accepted: 20
[Submit][Status][Web Board]

Description

zp was late many times, but every time he got lazy to buy a very small watermelon. Lv later criticized him, asked him to buy a watermelon which can not be less than some weight. he found that the biggest watermelon is not able to reach the required weight by lv, every time must buy two to meet the requirements. zp late again, then the summer training team demanded if zp late, he has to buy Triple watermelon . To save money,he decides to  buy a maximum and minimum , and then the second-largest and second smallest, and third largest and third smallest. Now we ask you to find out the six  watermelon to meet such requirements.If there are the same weight watermelon, regarded as one watermalen.and third largest and third small to meet. Now we ask you to find out the six  watermelon to meet such requirements.

Input

Multiple sets of test samples, the beginning of a n (6 <= n <150000), followed by  n a [i] (a [i]> 0, a [i] <100000000), 
on behalf of the weight of watermelon.It guarantees that there are at least 6 different weight watermelon.

Output

For each test output a line, each line has 6 numbers, three big numbers  in descending order,and three small numbers in ascending order.

Sample Input

6
1 2 3 4 5 6

Sample Output

6 5 4 1 2 3

Author

zyy

[Submit][Status][Web Board]