3D Printing

아직 제출이 없습니다시간 제한5초메모리 제한1024 MB

문제

You are part of the executive committee of the Database Design Day festivities. You are in charge of promotions and want to print three D's to create a logo of the contest. You can choose any color you want to print them, but all three have to be printed in the same color.

You were given three printers and will use each one to print one of the D's. All printers use ink from 44 individual cartridges of different colors (cyan, magenta, yellow, and black) to form any color. For these printers, a color is uniquely defined by 44 non-negative integers cc, mm, yy, and kk, which indicate the number of ink units of cyan, magenta, yellow, and black ink (respectively) needed to make the color.

The total amount of ink needed to print a single D is exactly 10610^6 units. For example, printing a D in pure yellow would use 10610^6 units of yellow ink and 00 from all others. Printing a D in the Code Jam red uses 00 units of cyan ink, 500000500000 units of magenta ink, 450000450000 units of yellow ink, and 5000050000 units of black ink.

To print a color, a printer must have at least the required amount of ink for each of its 44 color cartridges. Given the number of units of ink each printer has in each cartridge, output any color, defined as 44 non-negative integers that add up to 10610^6, such that all three printers have enough ink to print it.

입력

The first line of the input gives the number of test cases, TT. TT test cases follow. Each test case consists of 33 lines. The ii-th line of a test case contains 44 integers C_iC\_i, M_iM\_i, Y_iY\_i, and K_iK\_i, representing the number of ink units in the ii-th printer's cartridge for the colors cyan, magenta, yellow, and black, respectively.

출력

For each test case, output one line containing Case #x: r, where xx is the test case number (starting from 1) and rr is IMPOSSIBLE if there is no color that can be printed by all 33 printers. Otherwise, rr must be equal to "cc mm yy kk" where cc, mm, yy, and kk are non-negative integers that add up to 10610^6 and cC_ic≤C\_i, mM_im≤M\_i, yY_iy≤Y\_i, and kK_ik≤K\_i, for all ii.

If there are multiple solutions, you may output any one of them.

힌트

Sample Case #1 is the image provided above. The proposed color is using up all of the ink in the cyan, magenta, and yellow cartridges of the first printer and all of the ink in the black cartridge of the last printer. This means that no additional unit of ink could be used from any of the 44 ink colors, so the given sample output is the only possible output for this case.

In Sample Case #2, magenta is the only color that both the first and second printers have, so our only chance would be to use 10610^6 units of magenta. Unfortunately, the third printer does not have quite enough, making this case impossible.

In Sample Case #3, other correct outputs are: "400000 100000 100000 400000", "300000 0 0 700000", and "350000 140000 160000 350000", among lots of others. Notice that "300000 140000 160000 700000" would not be a valid answer because, even though there is enough ink in all printers to do that, the total number of ink units must be exactly 10610^6.