Write a program that, given a natural number m and n different words s1, …, sn, prints all the subsets of m elements that can be made up with the words.
Input
Input consists of two natural numbers m and n, followed by s1, …, sn. Assume n > 0 and 0 ≤ m ≤ n.
Output
Print all the subsets of m words that can be made up with s1, …, sn.
You can print in any order both the solutions and the elements inside each solution.
Input
2 5 hola adeu hi hello bye
Output
{hello,bye}
{hi,bye}
{hi,hello}
{adeu,bye}
{adeu,hello}
{adeu,hi}
{hola,bye}
{hola,hello}
{hola,hi}
{hola,adeu}