Igor the analyst fell asleep on the work and had a strange dream. In the dream his desk was crowded with computer mice, so he bought a mousetrap to catch them.

The desk can be considered as an infinite plane, then the mousetrap is a rectangle which sides are parallel to the axes, and which opposite sides are located in points (*x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>) and (*x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>).

Igor wants to catch all mice. Igor has analysed their behavior and discovered that each mouse is moving along a straight line with constant speed, the speed of the *i*-th mouse is equal to (*v*<sub class="lower-index">*i*</sub><sup class="upper-index">*x*</sup>, *v*<sub class="lower-index">*i*</sub><sup class="upper-index">*y*</sup>), that means that the *x* coordinate of the mouse increases by *v*<sub class="lower-index">*i*</sub><sup class="upper-index">*x*</sup> units per second, while the *y* coordinates increases by *v*<sub class="lower-index">*i*</sub><sup class="upper-index">*y*</sup> units. The mousetrap is open initially so that the mice are able to move freely on the desk. Igor can close the mousetrap at any moment catching all the mice that are strictly inside the mousetrap.

Igor works a lot, so he is busy in the dream as well, and he asks you to write a program that by given mousetrap's coordinates, the initial coordinates of the mice and their speeds determines the earliest time moment in which he is able to catch all the mice. Please note that Igor can close the mousetrap only once.
The first line contains single integer *n* (1 ≤ *n* ≤ 100 000) — the number of computer mice on the desk.

The second line contains four integers *x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub> and *y*<sub class="lower-index">2</sub> (0 ≤ *x*<sub class="lower-index">1</sub> ≤ *x*<sub class="lower-index">2</sub> ≤ 100 000), (0 ≤ *y*<sub class="lower-index">1</sub> ≤ *y*<sub class="lower-index">2</sub> ≤ 100 000) — the coordinates of the opposite corners of the mousetrap.

The next *n* lines contain the information about mice.

The *i*-th of these lines contains four integers *r*<sub class="lower-index">*i*</sub><sup class="upper-index">*x*</sup>, *r*<sub class="lower-index">*i*</sub><sup class="upper-index">*y*</sup>, *v*<sub class="lower-index">*i*</sub><sup class="upper-index">*x*</sup> and *v*<sub class="lower-index">*i*</sub><sup class="upper-index">*y*</sup>, (0 ≤ *r*<sub class="lower-index">*i*</sub><sup class="upper-index">*x*</sup>, *r*<sub class="lower-index">*i*</sub><sup class="upper-index">*y*</sup> ≤ 100 000,  - 100 000 ≤ *v*<sub class="lower-index">*i*</sub><sup class="upper-index">*x*</sup>, *v*<sub class="lower-index">*i*</sub><sup class="upper-index">*y*</sup> ≤ 100 000), where (*r*<sub class="lower-index">*i*</sub><sup class="upper-index">*x*</sup>, *r*<sub class="lower-index">*i*</sub><sup class="upper-index">*y*</sup>) is the initial position of the mouse, and (*v*<sub class="lower-index">*i*</sub><sup class="upper-index">*x*</sup>, *v*<sub class="lower-index">*i*</sub><sup class="upper-index">*y*</sup>) is its speed.
Here is a picture of the first sample

Points A, B, C, D - start mice positions, segments are their paths.

<img class="tex-graphics" src="https://espresso.codeforces.com/9b2a39ff850b63eb3f41de7ce9efc61a192e99b5.png" style="max-width: 100.0%;max-height: 100.0%;"/>

Then, at first time when all mice will be in rectangle it will be looks like this:

<img class="tex-graphics" src="https://espresso.codeforces.com/bfdaed392636d2b1790e7986ca711c1c3ebe298c.png" style="max-width: 100.0%;max-height: 100.0%;"/>

Here is a picture of the second sample

<img class="tex-graphics" src="https://espresso.codeforces.com/a49c381e9f3e453fe5be91a972128def69042e45.png" style="max-width: 100.0%;max-height: 100.0%;"/>

Points A, D, B will never enter rectangle.
4
7 7 9 8
3 5 7 5
7 5 2 4
3 3 7 8
6 6 3 2
0.57142857142857139685
4
7 7 9 8
0 3 -5 4
5 0 5 4
9 9 -1 -6
10 5 -7 -10
-1
4
8 42 60 54
9 54 -58 -62
46 47 52 -76
15 50 -37 -40
54 51 78 64
0.00000000000000000000
4
17501 63318 51967 74514
1305 84026 79493 -78504
41159 81000 -44104 -42722
31063 65435 25578 33487
18330 79949 83467 -74531
0.20374120991785441004
7
24 38 44 47
44 45 -50 -36
33 48 -11 -39
43 44 13 15
42 47 24 -21
40 41 19 7
26 41 -20 -15
42 40 43 19
0.02564102564102564014
1
0 0 100000 100000
0 0 1 0
-1
1
0 0 100000 100000
0 0 0 1
-1
1
0 0 100000 100000
0 0 -1 -1
-1
1
0 0 100000 100000
1 1 1 1
0.00000000000000000000
1
0 0 10000 10000
20000 2 -1 0
10000.00000000000000000000
1
0 0 10000 10000
20000 2 1 0
-1
1
0 0 10000 10000
10001 10001 -1 -1
1.00000000000000000000
1
0 0 10000 10000
10001 9999 -1 1
-1
1
1 1 1 1
1 1 1 1
-1
1
0 0 10 10
5 5 0 0
0.00000000000000000000
1
0 0 10 10
5 5 5 5
0.00000000000000000000
1
0 1 2 1
0 0 1 1
-1
1
1 1 5 5
1 0 0 1
-1
1
1 1 2 2
1 1 1 0
-1
2
2 2 5 5
3 3 1 1
10 3 -1 0
-1
1
99998 99998 99999 99999
0 0 99999 100000
0.99998999989999903804
1
1 1 3 3
2 2 0 0
0.00000000000000000000
2
99999 99999 100000 100000
1 1 100000 100000
1 1 99999 99999
0.99998999989999903804
1
0 0 2 2
1 1 0 0
0.00000000000000000000
1
0 0 1 1
0 0 0 0
-1
1
0 0 1 1
0 0 1 0
-1
1
7 7 8 8
7 7 0 0
-1
1
1 1 3 3
4 4 0 0
-1
1
0 0 2 2
1 0 0 0
-1
1
0 0 99999 1
0 99999 100000 -99999
0.99998999989999903804
1
1 0 2 0
0 0 1 0
-1
1
1 1 11 11
5 5 0 0
0.00000000000000000000
1
1 1 1 1
1 1 0 0
-1
4
0 49998 2 50002
1 50000 0 0
1 50000 0 0
1 0 0 1
1 100000 0 -1
49998.00000000000000000000
1
0 0 10 10
0 0 0 0
-1
1
1 1 11 11
1 2 0 1
-1
1
0 0 100 100
0 0 1 0
-1
1
1 0 1 2
0 0 1 1
-1
1
1 1 3 3
1 1 0 0
-1
2
0 0 5 5
5 3 0 1
3 3 1 1
-1
1
1 1 3 3
1 1 1 0
-1
1
10 10 20 20
0 10 1 1
-1
1
5 5 10 10
4 6 1 0
1.00000000000000000000
1
0 0 5 5
2 5 0 0
-1
1
1 1 2 2
0 2 1 0
-1
1
1 1 3 3
0 1 1 0
-1
1
1 1 2 2
1 1 0 0
-1
2
10 0 12 2
9 1 1 0
7 1 1 0
-1
1
2 2 4 4
3 1 1 1
-1
2
1 1 3 3
2 10 0 -1
10000 2 -1 0
-1
1
1 1 3 3
2 0 1 1
-1
2
0 0 2 100000
1 1 0 100000
100000 1 -99999 0
0.99998999989999903804
2
1 1 2 2
0 0 1 1
1 1 1 1
-1
1
0 0 2 2
0 1 0 0
-1
1
1 1 2 2
0 0 0 0
-1
1
0 0 10 10
0 0 0 1337
-1
1
1 1 3 3
1 1 0 1
-1
1
0 0 2 2
0 1 0 1
-1
1
1 1 3 3
2 1 0 0
-1
1
0 0 3 3
1 3 1 0
-1
1
0 0 100 100
0 0 100 0
-1
#!/usr/bin/env python
import sys
from operator import itemgetter

def intersect_at(x, y, vx, vy, line_x, line_y1, line_y2):
    """
    returns None if the mouce does not cross the line
    """
    candidate = (line_x - x) / float(vx)
    y_at_candidate = y + vy * candidate
    if candidate < 0:
        return None
    elif y_at_candidate < line_y1 or y_at_candidate > line_y2:
        return None
    else:
        return candidate
def scan(f, lst, init=None):
    prev = init
    if prev is None:
        prev = lst[0]
        lst = lst[1:]
    for elem in lst:
        prev = f(prev, elem)
        yield prev

def main():
    num_mice= int(sys.stdin.readline().rstrip())
    x1, y1, x2, y2 = map(int, sys.stdin.readline().split())
    mice = []
    for indx in range(num_mice):
        mice.append(list(map(int, sys.stdin.readline().split())))

    intersection_times = []
    for indx in range(num_mice):
        x,y,vx,vy = mice[indx]
        times = [
            intersect_at(x, y, vx, vy, x1, y1, y2),
            intersect_at(x, y, vx, vy, x2, y1, y2),
            intersect_at(y, x, vy, vx, y1, x1, x2),
            intersect_at(y, x, vy, vx, y2, x1, x2)
        ]
        times = list(filter(lambda x: x, times))
        if len(times) > 2:
            times = list(set(times))
        times = sorted(times)
        times = list(map(lambda tup: (tup[1], (1 - tup[0]) * 2 - 1 ), enumerate(times)))
        if not times:
            print("-1")
            return
        intersection_times += times
    intersection_times = sorted(intersection_times, key=itemgetter(0))

    intersections = list(scan(lambda acc, elem: (elem[0], acc[1] + elem[1]), intersection_times, (None, 0)))
    time = next((t for t, cnt in intersections if cnt == num_mice), None)
    if time is None:
        print("-1")
    else:
        print(str(time))

main()
