For a given natural number n, derive all permutations of integers from 1 to n to k numbers in lexicographic order.
Two natural numbers n and k (1≤k≤n≤8).
Derive all permutations of integers from 1 to n to k numbers in lexicographic order. Each permutation should be displayed on a separate line.