N and M (1)

Print every length-M sequence of distinct numbers chosen from 1 to N, in increasing lexicographic order.

Easy3BacktrackingRecursionInterviewNo attempts yetTime limit1sMemory limit512 MB

Problem

You are given natural numbers NN and MM. Write a program that finds every sequence of length MM made by choosing MM numbers from 11 to NN without repetition.

Input

The first line contains the natural numbers NN and MM, separated by a space. (1MN81 \le M \le N \le 8)

Output

Print the sequences that satisfy the condition, one per line. Do not print the same sequence twice, and separate the numbers of a sequence with a space. Print the sequences in increasing lexicographic order.