Intersection of Rectangles#4428

Intersection of Rectangles

1 second
64 megabytes
Very easy

In the plane, there are rectangles, each with vertices at integer coordinates and sides parallel to the coordinate axes. Find the rectangle that represents the intersection of all these rectangles.

You should justify that this intersection is always a rectangle (possibly degenerated to a line segment or a point).

Input

The first line contains the integer (1 \leq n \leq 1500). Each of the next lines contains four integers x_1, y_1, x_2, y_2 — the coordinates of the bottom-left and top-right corners of a rectangle, respectively (-10^9 \leq x_1 \leq x_2 \leq 10^9, -10^9 \leq y_1 \leq y_2 \leq 10^9).

Note that rectangles may degenerate into line segments or points.

Output

Print a single line with the description of the intersection rectangle in the same format as the input rectangles. If the intersection is empty, print a single number .

Examples

Example 1

Loading
Loading