Segments intersection - 2#1505

Segments intersection - 2

8.5 seconds
128 megabytes
Easy

segments are given on the 2-D plane. Determine whether any two of them intersect, i.e., if there exists at least one pair of segments that share at least one common point.

Input

Each line contains the integer coordinates of the endpoints of a segment: (x_1, y_1) and (x_2, y_2). It is known that n \leq 6 \times 10^5 and -2000 \leq x_1, y_1, x_2, y_2 \leq 2000.

Output

Print **"intersect"** if any two segments intersect, or **"NOT intersect"** otherwise.

Examples

Example 1

Loading
Loading