Problem D: 练57.1 全排列问题

Memory Limit:64 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:5 Solved:1

Description

输出自然数 $1$ 到 $n$ 所有不重复的排列,即 $n$ 的全排列,要求所产生的任一数字序列中不允许出现重复的数字。

Input

一个整数$n$ ($1≤n≤9$)。

Output

由$1sim n$ 组成的所有不重复的数字序列,每行一个序列。每个数字保留 $5$ 个场宽。

Sample Input Copy

3

Sample Output Copy

1    2    3
1    3    2
2    1    3
2    3    1
3    1    2
3    2    1