A polynomial of degree can be used to approximate a function by setting the coefficients of to match the first coefficients of the power series of (expanded about x = 0). For example,

Unfortunately, polynomials are "nice" and they do not work well when they are used to approximate functions that behave poorly (e.g. those with singularities). To overcome this problem, we can instead approximate functions by rational functions of the form p(x)/q(x), where and are polynomials. You have been asked by Approximate Calculation Machinery to solve this problem, so they can incorporate your solution into their approximate calculation software.
Given , , and the first m+n coefficients of the power series of , we wish to compute two polynomials and of degrees at most m-1 and n-1, respectively, such that the power series expansion of q(x) \cdot f(x) - p(x) has as its first m+n-1 coefficients, and as its coefficient corresponding to the x^{m+n-1} term. In other words, we want to find and such that

where ... contains terms with powers of higher than m+n-1. From this, can be approximated by p(x)/q(x).
Background Definitions
A polynomial of degree can be written as p_0 + p_1x + p_2x^2 + \ldots + p_nx^n, where p_i's are integers in this problem.
A power series expansion of about can be written as f_0 + f_1x + f_2x^2 + \ldots, where f_i's are integers in this problem.
The input will consist of multiple cases. Each case will be specified on one line, in the form f_0 f_1 f_{m+n-1} where f_i is the coefficient of x^i in the power series expansion of . You may assume that 1 \le m, 1 \le n \le 4, 2 \le m+n \le 10, and f_i are integers such that |f_i| \le 5. The end of input will be indicated by a line containing m = n = 0, and no coefficients for . You may assume that there is a unique solution for the given input.
For each test case, print two lines of output. Print the polynomial on the first line, and then on the second line. The polynomial should be printed as a list of pairs (p_i, i) arranged in ascending order in , such that p_i is a non-zero coefficient for the term x^i. Each non-zero coefficient p_i should be printed as , where b > 0 and is the coefficient expressed in lowest terms. In addition, if b = 1 then print only (and omit ). If p(x) = 0, print a line containing only . Separate the pairs in the list by one space. The polynomial should be printed in the same manner. Insert a blank line between cases.
Example 1