Segment Intersection#708

Segment Intersection

2 seconds
256 megabytes
Easy

A collection of sticks is scattered on a table. Each stick is a line segment of nonzero length on a plane. You need to find two sticks that intersect. If such sticks exist, output the numbers of any two intersecting sticks.

Input

The first line contains the number (1 \leq N \leq 125000)—the number of sticks on the table. The next lines contain the descriptions of the sticks: the (i+1)-st line contains the coordinates of the endpoints of the -th stick—integers x_1, y_1, x_2, y_2 (-10000 \leq x_1, y_1, x_2, y_2 \leq 10000).

Output

Print "YES" on the first line if there exist sticks that intersect. On the second line, print the numbers and : —the number of the first stick, —the number of the stick it intersects with.

If there are no intersecting sticks, print "NO".

Examples

Example 1

Loading
Loading