# Mathemagicland

Jack has been abducted by a man in black suit to Mathemagicland. Fortunately, he met a friend Donald Duck. Donald Duck will help him escape only if he first finds all n-tuple solutions: {x1,x2,...,xn} and extract the rational numbers in order of magnitude from the n-tuple above, given that: {σ1,σ2,...,σn} where σk = are called the elementary symmetric polynomials. For example: if n = 1, then σ1= ∑∏k ∑∏1 xaj = xaj =x1 ∑ ∏k 1≤a1<a2<...<a1−1<a1≤n j=1 xaj 1≤a1≤n j=1 1≤a1≤1 j=1 If n = 2, then σ1 = σ2 = If n = 3, then σ1 = σ2 = σ3 = If n = 4, then However, since most irrational numbers are impossible to represent exactly using a computer, you are only required to output the rational components of in numerical order. ∑ ∏k 1≤a1≤n j=1 ∑ ∏k 1≤a1≤n j=1 ∑ ∑ ∏1 1≤a1≤2 j=1 ∑ 1≤a1≤2 xaj = 1≤a1<a2≤2 1≤a1<a2≤3 j=1 1≤a1<a2≤3 xaj= xaj = xaj= ∑ ∏2 xa1=x1+x2 ∑ xa1xa2 =x1x2 xa1 =x1+x2+x3 ∑∏2 ∑ 1≤a1 ≤3 1≤a1<a2≤2 j=1 xaj = xa1xa2 =x1x2+x1x3+x2x3 ∑∏3 ∑ xaj = xa1xa2xa3 =x1x2x3 1≤a1<a2<a3≤3 j=1 1≤a1<a2<a3≤3 σ1 = x1+x2+x3+x4 σ2 = x1x2 +x1x3 +x1x4 +x2x3 +x2x4 +x3x4 σ3 = x1x2x3 + x1x2x4 + x1x3x4 + x2x3x4 σ4 = x1x2x3x4

2/2 Input There are less than 1001 test cases. For each test case, the first line contains two integers n and k, n > 0, |k| > 0, n < 101 ,|k| < 1001. The second line contains n integers separated by a single space, kσ1 kσ2 ... kσn After the last test case, a single integer of ‘0’ is given. Output Each n-tuple solution should be outputted in exactly one line and in the form of: kxa1 kxa2 ... kxam Such that {a }⊆{1,2,3,...,n}suchthatx ∈Q, kx ≤kx ≤...≤kx m a1a1a2an Two n-tuple solutions are said to be the same if they have the same output. Two solutions are said to be distinct if they are not the same. Output all distinct solutions in lexicographical order, one in each line. If there is no solution, output ‘No solution.’ without quotes. Print a blank line between each test case. Note: All inputs/outputs will fit into a standard 32-bit signed integer. Sample Input 21 21 0 Sample Output 11