Permutations#2169

Permutations

1 second
128 megabytes
Easy

Given a positive integer , print all permutations of the integers from to in lexicographical order.

Input

One positive integer where 1 \le n \le 8 is given.

Output

Print all permutations of the integers from to in lexicographical order. Print each permutation on a separate line.

Examples

Example 1

Loading
Loading