Thus, Ralph tortured the spy until he disclosed how to decode the
engraved message: The encrypted message is a single line of
numbers.
One has to apply the following decoding
procedure for
times: add to each number
times the number to its left and
times the number to its right.
Note, that due to the cyclic engraving each number has exactly two neighbours.
As numbers can be quite large,
one only has to take care of the
lower digits.
Unfortunately, Ralph has never learnt how to add and multiply numbers. Please help him!
Input
The first line indicates the number
of test cases that follow.
Test cases are separated by a blank line. Each test case starts with a line holding
,
,
,
,
and
separated by single spaces (
,
,
). The next line contains
numbers (separated by single spaces). These numbers are the encrypted
message from left to right. Each of these numbers is a non-negative integer
less than
.
Output
For each test case, output one line containing the
decrypted numbers,
separated by single spaces.
Sample Input
3 0 1 1 3
23 42 0
3 1 1 1 3
23 42 0
4 10 2 1 9
1 2 3 4
5 999999999 3 8 7
8 7 8 7 12
Sample Output