Grafix Mask#2382

Grafix Mask

1.5 seconds
64 megabytes
Very easy

In one mode of the grafix software package, the user blocks off portions of a masking layer using opaque rectangles. The bitmap used as the masking layer is pixels tall and pixels wide. Once the rectangles have been blocked off, the user can perform painting actions through the remaining areas of the masking layer, known as holes. To be precise, each hole is a maximal collection of contiguous pixels that are not covered by any of the opaque rectangles. Two pixels are contiguous if they share an edge, and contiguity is transitive.

You are given the rectangles that have been blocked off in the masking layer. Find the area, in pixels, of every hole in the resulting masking area, sorted from smallest to largest.

The left picture contains two holes, the right picture contains nine holes.

Input

Consists of multiple test cases. The first line of each test case contains the integer (1 \leq n \leq 50) — the number of rectangles. Each of the next lines gives the coordinates of opposite corners of a rectangle in the form "\text{row}\ \text{column}\ \text{row}\ \text{column}" (0 \leq \text{row} \leq 399, 0 \leq \text{column} \leq 599). The first pair of numbers are the coordinates of the top left pixel of the rectangle, and the second pair are the coordinates of its bottom right pixel.

Output

For each test case, print in a separate line the list of hole areas in increasing order. If for some test case the resulting masking area does not contain holes, print an empty line.

Examples

Example 1

Loading
Loading