Box Art

No attempts yetTime limit1sMemory limit128 MB

Problem

The world-famous artist A.A. Blox, celebrated for his cubic sculptures, has invented a brand-new way to create striking artwork from a rectangular block of transparent acrylic glass. Using the patented laser device built by his friend T.D. Resal, he can change the colour of parts of the originally colourless block. Because the laser device is still a prototype, he can only colour a rectangular region whose faces are parallel to the faces of the large block ("axis aligned").

The value of the finished piece is the volume of coloured acrylic glass. Since A.A. Blox is not fond of mathematics, he has hired you to compute the price of his artwork.

Given an axis-aligned initial box bb and a set SS of axis-aligned boxes, compute the volume of the union of all parts of the boxes in SS that lie inside bb. Volume covered by several boxes must be counted only once.

Input

The first line contains the number of scenarios.

Each scenario begins with a line x1 y1 z1 x2 y2 z2 giving the two opposite corners (x1,y1,z1)(x_1, y_1, z_1) and (x2,y2,z2)(x_2, y_2, z_2) of the initial box bb. The numbers are separated by single spaces.

The next line contains the number mm (m2000m \le 2000) of boxes in SS that were coloured by the laser device, followed by mm lines, each containing x1 y1 z1 x2 y2 z2 for the two opposite corners of one box in SS.

All coordinates are integers in the range 00 to 10001000, and every line satisfies x1x2x_1 \le x_2, y1y2y_1 \le y_2, and z1z2z_1 \le z_2.

Output

For every scenario, first print a line Scenario #i:, where ii is the scenario number starting at 11. Then print a line with the total volume of coloured acrylic glass. Separate consecutive scenarios with a blank line.