Second International Programming Contest
March 28, 2004, Blagoevgrad, Bulgaria
Problem G
Wine
In the winery of Iuzun city they made three kinds of wine, as they mixed up three types of grapes in different concentration ratios in each type of wine. For the preparation of these wines they got the right concentrations from a table hanged on the wall in director’s office. This table was also on the desktops of all the computers in the winery. 
      sort of grapes
wine	I	II	III	
І	a1	a2	a3	
ІІ	b1	b2	b3	
ІІІ	c1	c2	c3	
One day, a very important man came in the city and his taste of wines was very special. On one of the dinners that the people of the city organized for him, they offered him the three kinds of wine, made by them, and he didn’t approve these kinds. He liked the color of the one; the smell of the other and the third had unique taste. So he asked them to make such a wine that is a combination between these three types. The winery has 100 liters of each wine. Fortunately the director of the winery had brought his best mathematician, who quickly calculated the exact concentrations of the three sorts of grapes that had to be included in the new wine (d1, d2, d3). Unfortunately, it was too late. The winery closed and they could not get pure extracts from the three sorts of grapes, and they had only the three wines. Then the only thing that had to be done was to calculate the quantity of each wine that should be mixed up to make the new wine. Here the director remembered your telephone number and he called you to write a program that makes the necessary calculations.
Input data should be read from the standard input. On the first row of the input there is an integer n that shows the number of the tests. Each test contains 4 rows. In the first row there are 3 numbers: the concentrations of the first type of wine, the second type and the third. In the next 3 rows is placed the table: the first column shows the concentration of the first sort of the grape, the second is for the second sort of grapes and the third – for the last sort of grapes. 
Your result should be written on the standard output. It should contain a row for a test. The first three numbers are the corresponding quantities for the three types of wine that should be mixed and the last number of the row is the amount of the new wine.

Example:
Input									Output
1
3 	4	5				8 	1	5	7
1	2	3
3	7	1
2	1	2