Write a program that, given two numbers and , prints all the multisets that can be made up with , in such a way that every number appears at most times.
Input consists of a natural number , followed by a natural number .
Print all the multisets that can be made with , using each number at most times. The numbers inside each multiset must appear in non-decreasing order.
You can print the solutions to this exercise in any order.
Input
2 3
Output
{}
{2}
{2,2}
{2,2,2}
{1}
{1,2}
{1,2,2}
{1,2,2,2}
{1,1}
{1,1,2}
{1,1,2,2}
{1,1,2,2,2}
{1,1,1}
{1,1,1,2}
{1,1,1,2,2}
{1,1,1,2,2,2}