Problems
In Lotto, you must choose 6 numbers from the set {1, 2, 3, …, 48, 49}.
There are many strategies for choosing Lotto numbers, but here we assume that
For example, when
S = {1, 2, 3, 5, 8, 13, 21, 34},
the possible Lotto combinations are:
[1, 2, 3, 5, 8, 13],
[1, 2, 3, 5, 8, 21],
[1, 2, 3, 5, 8, 34],
[1, 2, 3, 5, 13, 21],
…
[3, 5, 8, 13, 21, 34],
for a total of 28 combinations.
Write a program that, given
Input
A single line of integers is given.
The first number is
Following that,
Output
Print all possible Lotto number combinations that can be formed using the given
Each combination must contain 6 numbers, and:
The 6 numbers within each line must be in ascending order.
The combinations themselves must also be printed in ascending order, one per line.
Example
7 1 2 3 4 5 6 7
1 2 3 4 5 6
1 2 3 4 5 7
1 2 3 4 6 7
1 2 3 5 6 7
1 2 4 5 6 7
1 3 4 5 6 7
2 3 4 5 6 7