All permutations of given length#4815

All permutations of given length

1 second
128 megabytes
Very easy

Given number . Print all permutations of numbers from to in lexicographical order.

Input

One number , 0 < n < 10.

Output

Print all permutations of numbers from to in lexicographical order. Print each permutation on a separate line. Do not print spaces between numbers on a line.

Examples

Example 1

Loading
Loading