土拨鼠进监狱

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

土拨鼠进监狱了,他需要写出n的全排列才能出狱。

Description

给出n,输出n的全排列。

Format

Input

一行,一个数n

Output

n!n!行,每行是n的一个全排列,按字典序输出。

Samples

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

Limitation

1秒,256mb。n<=8n<=8

KUNKKA做不了满分的题

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
24
Start at
2024-1-20 19:30
End at
2024-3-2 11:30
Duration
1000 hour(s)
Host
Partic.
7