Problems
Permutations
Permutations
Given a positive integer $n$, print all permutations of the integers from $1$ to $n$ in lexicographical order.
\InputFile
One positive integer $n\:(1 \le n \le 8)$.
\OutputFile
Print all permutations of the integers from $1$ to $n$ in lexicographical order. Print each permutation on a separate line.
Input example #1
3
Output example #1
1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1