J. Only Two
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

In this problem, you are given $$$2$$$ points describing a square (i.e. the upper right and lower left corners) such that the sides of the square are parallel to either $$$x$$$-axis and $$$y$$$-axis.

You are also given $$$n$$$ segments such that each segment is strictly inside the square and parallel to one of the axes.

You need to find whether there exist two segments $$$i$$$ and $$$j$$$ ($$$i \neq j$$$) such that if both were extended to a line, they divide the square into multiple rectangles, where only two of them are equal$$$^\dagger$$$.

$$$^\dagger$$$ Two rectangles are considered equal if their sides are equal apart from the vertical or horizontal alignment.

Input

The first line contains five integers $$$n,x_s,y_s,x_e,y_e$$$ $$$(1 \le n \le 10^5, 1 \le x_s,y_s,x_e,y_e \le 10^9)$$$ — the number of segments, and the coordinates of the lower left and upper right corners of the square.

Each of the next $$$n$$$ lines contains four integers $$$x_1, y_1, x_2, y_2$$$ $$$(1 \le x_1, y_1, x_2, y_2 \le 10^9)$$$ — the coordinates of the endpoints of the segments.

It is guaranteed that all the segments are parallel to one of the coordinate axes, and strictly lie inside the square. Segments may touch, overlap, and even completely coincide.

Output

On a single line, print the two indices of segments you chose. If there are multiple answers, you may print any of them. Otherwise, if there is no answer, print "$$$-1$$$ $$$-1$$$" (without quotation marks).

Example
Input
6 1 1 10 10
9 8 8 8
9 5 3 5
5 2 5 8
4 4 7 4
7 3 7 5
6 2 6 9
Output
4 5