LearnPy Hub
← Arena
IntermediateRating 1200

All Groups of k

Print every way to choose k numbers from 1 … n, one group per line in increasing order, with the groups in alphabetical (lexicographic) order.

Input

Two integers n and k (1 ≤ k ≤ n ≤ 10).

Output

The groups.

Sample 1

Input
4 2
Output
1 2
1 3
1 4
2 3
2 4
3 4

Sample 2

Input
3 3
Output
1 2 3
solution.py
Output appears here
All Groups of k · Python Arena problem · LearnPy Hub