Problem HR: 数字全排列

Problem HR: 数字全排列

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

SubmitProblemList

Description

输入一个数字n,求1,2,...,n,这n个数字组成的所有可能的n位数。
例:n为3时,1,2,3这三个数字可以组成的数字有
123
132
213
231
312
321

Input

一个数字n (2<=n<=7)

Output

1,2,...,n这n个数字组成的n位数
每行为一个n位数
输出顺序为:按n位数的大小排序,从小到大输出

Sample Input Copy

3

Sample Output Copy

123
132
213
231
312
321

HINT

深搜 排列树