You are given a discrete evolution process. At each moment, the state of the process is described by parameters x_1, x_2, \ldots, x_n. The evolution at each moment is determined by the following system of linear equations:
Find the state of the process at moment . Each parameter should be computed modulo .
The first line contains (1 \le T \le 100), the number of test cases. Each test case begins with a line containing two integers: (1 \le N \le 100), the number of parameters, and (0 \le M \le 10^9), the moment in time. Then lines follow, each containing integers separated by spaces. The -th integer in the -th line is a_{ij} (0 \le a_{ij} \le 10^9). Then, one more line follows, containing integers: the -th integer is x^0_j (0 \le x^0_j \le 10^9).
Output lines, each in the format Case #: x^M_1 x^M_2 x^M_n, where is the test case number (starting from ), and x^M_1, \ldots, x^M_n are the required parameters for that test case.
Example 1