Problem1247--数列排序

1247: 数列排序

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

将一正整数序列{K1,K2,...,K9}重新排列成一个新的序列。新序列中,比K1小的数都在K1的前面(左面),比K1大的数都在K1的后面(右面)。

Input

输入有多行,第一行为N表示行数,每行9个整数.

Output

输出N行,按要求进行排序的结果.

Sample Input Copy

2
6 8 9 1 2 5 4 7 3
3 5 8 9 1 2 6 4 7

Sample Output Copy

3 4 5 2 1 6 8 9 7
2 1 3 5 8 9 6 4 7

Source/Category

 集训六