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
The total amount of ink needed to print a single D is exactly
To print a color, a printer must have at least the required amount of ink for each of its
Input Specification
The first line of the input gives the number of test cases,
Output Specification
For each test case, output one line containing Case #x: r
, where IMPOSSIBLE
if there is no color that can be printed by all
Limits
Sample Input
3
300000 200000 300000 500000
300000 200000 500000 300000
300000 500000 300000 200000
1000000 1000000 0 0
0 1000000 1000000 1000000
999999 999999 999999 999999
768763 148041 178147 984173
699508 515362 534729 714381
949704 625054 946212 951187
Sample Output
Case #1: 300000 200000 300000 200000
Case #2: IMPOSSIBLE
Case #3: 400001 100002 100003 399994
Explanation for Sample
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
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
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
Comments