#K10631. Alphabet Permutations

    ID: 23290 Type: Default 1000ms 256MiB

Alphabet Permutations

Alphabet Permutations

Given an integer n satisfying \(2 \leq n \leq 20\), generate all permutations of the first n letters of the English alphabet. The generated permutations must be sorted in lexicographical order. Each permutation is printed on a separate line.

inputFormat

The input is read from stdin and consists of a single integer n.

outputFormat

Output all the lexicographically sorted permutations of the first n letters of the English alphabet. Each permutation should be printed on a separate line to stdout.

## sample
2
ab

ba

</p>