2284: N个任意数的全排列

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:125 Solved:86

Description

已知 n 个整数 x1x2…xn(从小到大排列好的),输出这 n 个整数的全排列。

Input

输入数据包含两行:
第一行包含一个正整数n (1<=n<=10) 
第二行 包含n个正整数x1,x2,…xn(1<=xi<=9)。



Output

输出若干行,每行包括n个数据,每个数据用两个位置输出,表示一种排列方案。

Sample Input Copy

3
5 7 9

Sample Output Copy

5 7 9
5 9 7
7 5 9
7 9 5
9 5 7
9 7 5

Source/Category