Write a program that, given a natural number and different words , prints all the subsets of elements that can be made up with the words.
Input consists of two natural numbers and , followed by . Assume and .
Print all the subsets of words that can be made up with .
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}