Segment and Rectangle#1360

Segment and Rectangle

1 second
64 megabytes
Medium

Does the segment with endpoints X_1, Y_1 and X_2, Y_2 intersect with a rectangle whose diagonal endpoints are X_3, Y_3 and X_4, Y_4, and whose sides are parallel to the coordinate axes? The segment and the rectangle intersect if they have at least one common point.

Input

The first line contains four integers X_1, Y_1, X_2, Y_2 — the coordinates of the segment's endpoints, separated by spaces. The second line contains four integers X_3, Y_3, X_4, Y_4 — the coordinates of the diagonal endpoints of the rectangle, separated by spaces. All coordinates are integers with absolute value not exceeding .

Output

Print if the rectangle and the segment intersect, otherwise print .

Examples

Example 1

Loading
Loading