On the first line of input is a single positive integer, 1 ≤ t ≤ 50, specifying the number of test cases to follow. Each test case begins with three integers ab, bc, ca ≤ 1000 on a line of itself. ab is the amount Alice owes Bob (negative if it is Bob who owes Alice money), bc the amount Bob owes Cynthia (negative if it is Cynthia who is in debt to Bob), and ca the amount Cynthia owes Alice (negative if it is Alice who owes Cynthia). Next follow three lines each with six non-negative integers a100, a50, a20, a10, a5, a1, b100, ... , b1, and c100, ... c1, respectively, where a100 is the number of 100 crown notes Alice got, a50 is the number of her 50 crown notes, and so on. Likewise, b100, . . . , b1 is the amount of notes/coins of different value Bob got, and c100, . . . , c1 describes Cynthia's money. Each of them has at most 30 coins (i.e. a10+a5+a1, b10+b5+b1, and c10+c5+c1, are all less than or equal to 30) and the total amount of all their money together (Alice's plus Bob's plus Cynthia's) is always less than 1000 crowns.
3
10 0 0
0 1 0 0 0 0
0 0 0 3 0 10
0 0 3 0 0 0
-10 -10 -10
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
-10 10 10
3 0 0 0 2 0
0 2 0 0 0 1
0 0 1 1 0 3
5
0
impossible