P1706 Full Permutation Problem

Description

Output, in lexicographic order, all non-repeating permutations of the natural numbers $1$ to $n$, i.e., the full set of permutations of $1$ to $n$. No generated sequence may contain repeated numbers.

Input Format

A single integer $n$.

Output Format

All non-repeating sequences composed of $1 \sim n$, one sequence per line. Each number should be printed in a field of width $5$.

Explanation/Hint

$1 \leq n \leq 9$。 Translated by ChatGPT 5