Problem2101-- Implementing the sorting of negation of numbers

2101: Implementing the sorting of negation of numbers

Time Limit: 1 Sec  Memory Limit: 512 MB
Submit: 13  Solved: 8
[Submit] [Status] [Web Board] [Creator:]

Description

List the given numbers in descending order of their negations.

Input

The input contains several test cases. Each case is a line of numbers. The line starts with an integer n representing the number of rest numbers which should be ordered according to their negations. n=0 means the end of input.

Output

For each test case, print one line containing the descending sequence of the numbers ordered according to their negations. In each line, the numbers are separated by a space.

Sample Input Copy

7 5 9 0 8 -11 2 -3
5 -4 5 6 9 2
0

Sample Output Copy

-11 -3 0 2 5 8 9
-4 2 5 6 9

Source/Category