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
/*
                                                                                                     
                                             `-:://:::-                                             
                                           `//:-------:/:`                                          
                                          .+:--.......--:+`                                         
                                         `+:--..`````..--//`                                        
                                         .o:--..`` ``..--:o`                                        
                                         .o:--...```..---+/`                                        
                                       `/y+o/---....---:+o.                                         
                                   `...````-os+/:---:/+o/--.`                                       
              `-/+++++/:.      `...`       :h+d+oooo+/+-`   ...                                     
            `/++//:::://++-`....`         -.`//````````:`     `..`                                  
           `o+/::------://o/`           `-` -.          -`       `..`                               
 `---.-o/:./o/::-..``..-ЗАПУСКАЕМ      ..  ..            -`        `...       ``..``                
  `....o+:-++/:--.```..-://s.        `-`  .-              -`          `-o: .-//::::/:-`             
          `:s+/:--....-::/+s-`      .-   `-                -`           -///:--------:/:`           
           ./s+//:::::://oo-``..НЕЙРОННУЮ: СЕТЬ:::::::-`РАБОТЯГИ        `+:--........--:/`          
            .:ooo+++++osso-`    `.:-...`/` ./::-------:/:`   -`         :+--..``````.--:+:...-+:-`  
             `.-/+++++/+-.-`    -.   ``:so:/:--.......--:+`  `-```````o+/+--..`````..--:o/-..:s+:.  
                 ```````:``.. `-`     -` `+:--..`````..--/+-.../.`````..-o:--.......---/o.    `     
                        `:  `:-      -.  .o:--..`` ``..--:o`   `-`      `:o+:--------:+o-`          
                         `-`-...    ..   .o/--...```..--:+/`    `-`     `oy/so/////++o/.`           
                          -/`  `-` `- ``+s/o/:---...---:++.      `-`   .-../d://///:-.`             
                `.---..``-..-    .-/..`````-oo+/:::::/+o+-        `-``-`  `-.  ````                 
             `:++++/+++++-  ..``.-/:`      /y-:/++o++/:.`..`       ./.   `-                         
            -++/::::::://+/..:-``:` ..   `-.`  ```.```    `..`   `..`-` `-                          
       ``  -o//:--....-::/++` -.-`   `-`.-`                 `..`..`  `-.-                           
  -----ss+:++/:--.```..-://s.  /.     `::                    `-:.     ./`                           
  `````/:..+o/::-..``.--:/+s. ..-`   `-``-`                 ..` `-`  `-`-`                          
          `-s+/::-----::/+oo---``-` ..    .:-    ```      .-`     .-.-  `-`                         
           `:oo+//::://+os/..:`..-/:`      :y.-:::::::.`.-`        ./-`  `-`                        
            `./+oooooooo+/.`-    .-:...`.. .//:-------://`        `- `..` `:.                       
              ``.-::::-.``-/`  `-` `-  `oo:+:--.......--:/`      `-    `.:--h.``..```               
                          -.-`.-    .-   `+:--..`````..--//`    `-       /s-//::::::::.             
                         -` `/-      ..  .o:--..`` ``..--:o.```.-        `//:--------://`           
                        -` .-`.-`     -.`-o/--...```..--:+/.``-:....``:-.+:--....`...--:+`          
                       ..`-.   `-.   ``:os:o/:---...---:++.  `-     ``///+:-..``````.--:+-````-.`   
              `.:///////.-`      .:-..` -``-+o+/:::::/+o/.  `-         `:+:-..`````..--:o/:--/ys+-  
            `-++///////+o/. ``....`-.    :` `.:++++++/:.`  .-           -o/---......---/o.   `.`    
           `++//:-----::/+o:..`     .-`   :    ```````    .-           `+so+:--------:++-`          
  `````:-``:o/::-..`..--:/+o`         -.  `-             .-          `../../+o+////+o+:.`           
  -----syo/o+/:--.```..-://s.          .-` `-           .-        `...     ``-:////:-``             
       .` `/s//:--....-::/+s.            -. `-`        .-       `..`                                
           .+o+/:::--:://+s/-..`          .::+y  ```  .-     `..`                                   
            ./oo++////+oso-`   `....       :y-+:::::::/`   ...                                      
             `.:+oooooo/-`         `....-. .//:-------:/:-.`                                        
                ``...``                 /+:+:--.......--:+`                                         
                                         `+:--..`````..--//`                                        
                                         .o:--..`` ``..--:o`                                        
                                         .+/--...```..--:+/`                                        
                                         `-o/:---...---:++.                                         
                                          `-+o+/:---:/+o/.                                          
                                            `.:+oooo+/-.`                                           
                                               ``````                                               
*/


#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <queue>
#include <ostream>
#include <istream>
#include <typeinfo>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <limits>
#include <fstream>
#include <array>
#include <list>
#include <bitset>
#include <functional>

#define mt make_tuple
#define x first
#define y second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define umap unordered_map
#define uset unordered_set
#define rt return 0;
#define elif else if
#define len(v) ((int)v.size())


using namespace std;

char string_in_buffer[(int)260];


void fast_scan(int &x) { scanf("%d", &x); }
void fast_scan(long long &x) { scanf("%lld", &x); }
void fast_scan(unsigned long long &x) { scanf("%llu", &x); }
void fast_scan(double &x) { scanf("%lf", &x); }
void fast_scan(long double &x) { scanf("%Lf", &x); }
void fast_scan(char &x) { 
	scanf("%c", &x); 
	if (x == '\n') {
		fast_scan(x);
	}
}
void fast_scan(string &x) {
	scanf("%s", string_in_buffer);
	x = string(string_in_buffer);
}

template<class TFirst, class TSecond>
void fast_scan(pair<TFirst, TSecond> &p) {
	fast_scan(p.first);
	fast_scan(p.second);
}

template <class T>
void fast_scan(vector<T> &v) {
	for (auto &x : v) fast_scan(x);
}

void fast_print(const int &x) { printf("%d", x); }
void fast_print(const long long &x) { printf("%lld", x); }
void fast_print(const unsigned long long &x) { printf("%llu", x); }
void fast_print(const double &x) { printf("%.15lf", x); }
void fast_print(const long double &x) { printf("%.15Lf", x); }
void fast_print(const char &x) { printf("%c", x); };
void fast_print(const string &x) { printf("%s", x.c_str());}

template<class TFirst, class TSecond>
void fast_print(const pair<TFirst, TSecond> &p) {
	fast_print(p.first);
	fast_print(' ');
	fast_print(p.second);
}

template <class T>
void fast_print(const vector<T> &v) {
	if (v.empty()) return;
	fast_print(v[0]);
	for (int i = 1; i < v.size(); i++) {
		fast_print(" ");
		fast_print(v[i]);
	}
}

template <class T>
void fast_print(const vector<vector<T>> &v) {
	if (v.empty()) return;
	fast_print(v[0]);
	for (int i = 1; i < v.size(); i++) {
		fast_print("\n");
		fast_print(v[i]);
	}
}



using namespace std;


namespace smart_io {
	string print_start = "";
	string sep = " ";
	bool first_print = false;

	void precall_print() {
		fast_print(print_start);
		print_start = "\n";
		first_print = true;
	}
} //namespace smart_io


template <class T>
ostream &operator,(ostream &os, const T &object) {
	if (!smart_io::first_print) {
		fast_print(smart_io::sep);
	} else {
		smart_io::first_print = false;
	}
	fast_print(object);
	return os;
}

template <class T>
istream &operator,(istream &is, T &object) {
	fast_scan(object);
	return is;
}

namespace typedefs {
	typedef long long ll;
	typedef unsigned long long ull;
	typedef pair<int, int> pii;
}

namespace numbers_operation {
	template<class T>
	T floor_mod(T a, T b) {
		if (a % b == 0) return 0;
		if (a >= 0 && b >= 0) return a % b;
		if (a <= 0 && b <= 0) return a % b;
		return abs(b) - (abs(a) % abs(b));
	}
}

using namespace numbers_operation;
using namespace typedefs;

#define print    \
smart_io::precall_print(); \
cout,

#define scan cin,
#define M_PI 3.14159265358979323

namespace geo {
#define double long double

const double EPS = 0.0000001;


double to_radians(double ang_deg) {
	return (ang_deg * M_PI / 180.0);
}

double to_degrees(double ang_rad) {
	return (ang_rad * 180.0 / M_PI);
}

bool eq(double a, double b = 0) {
	return abs(a - b) <= EPS;
}


class line;
class point;


class point {
public:
	double x, y;
	
	inline point() {}

	inline point(double _x, double _y):x(_x), y(_y) {}
	
	void set_polar(double _angle, double _dist) {
		x = cos(_angle) * _dist;
		y = sin(_angle) * _dist;
	}

	double length() {
		return hypot(x, y);
		// return sqrt(x * x + y * y);
	}

	double angle() {
		return atan2(y, x);
	}

	friend istream &operator>>(istream &is, point &p) {
		is >> p.x >> p.y;
		return is;
	}

	friend point operator-(point p1, point p2) {
		return point(p1.x - p2.x, p1.y - p2.y);
	}

	void operator-=(const point &p) {
		x -= p.x;
		y -= p.y;
	}

	point operator/(double d) {
		return point(x / d, y / d);
	}

	point operator*(double d) {
		return point(x * d, y * d);
	}

	void operator/=(double d) {
		x /= d;
		y /= d;
	}

	void operator*=(double d) {
		x *= d;
		y *= d;
	}

	point rotate90() {
		return point(-y, x);
	}

	point invert() {
		return point(-x, -y);
	}

	void set_length(double l) {
		double cur_len = length();
		x /= cur_len;
		y /= cur_len;
		x *= l;
		y *= l;
	}

	double operator*(const point &p) {
		return (x * p.x + y * p.y);
	}

	double operator^(const point &p) {
		return (x * p.y - y * p.x);
	}

	point operator+(point p) {
		return point(x + p.x, y + p.y);
	}

	void operator+=(point p) {
		x += p.x;
		y += p.y;
	}
	
	friend ostream &operator<<(ostream &os, const point &p) {
		os << p.x << " " << p.y;
		return os;
	}

	bool operator==(point p) {
		return eq(x, p.x) && eq(y, p.y);
	}

	bool operator<(const point &p) const {
		return vector<double>{x, y} < vector<double>{p.x, p.y};
	}

	double angle_to(point p) {
		return acos(((*this) * p) / (p.length() * length()));
	}
};


class line {
public:
	double a, b, c;

	line() {}

	line(double _a, double _b, double _c):a(_a), b(_b), c(_c) {}

	line(point p1, point p2) {
		set_abc(p1, p2);
	}

	void set_abc(point p1, point p2) {
		point p = p1 - p2;
		a = p.y;
		b = -p.x;
		c = -(a * p1.x + b * p1.y);	
	}

	double equate(point p) const {
		return a * p.x + b * p.y + c;
	}

	double distance(point p) {
		return abs((a * p.x + b * p.y + c) / (point(a, b).length()));
	}

	point intersect(line l) {
		double x = (-l.b * c + l.c * b) / (a * l.b - b * l.a);
		double y = (-a * l.c + c * l.a) / (-b * l.a + a * l.b);
		// cout << *this << ":" << l << "}";
		// cout << x << " " << y << " ";
		return point(x, y);
	}

	// point intersect2(line l) {
		// 
	// }

	double get_x(double y) {
		return (-b * y - c) / a;
	}

	double get_y(double x) {
		return (-a * x - c) / b;
	}

	bool parallel(line other) {
		return a * other.b == other.a * b;
	}

	bool equal(line other) {
		if (!parallel(other)) return false;
		if (!eq(b)) {
			return get_y(0) == other.get_y(0) && get_y(1) == other.get_y(1);
		} else if (!eq(a)) {
			return get_x(0) == other.get_x(0) && get_x(1) == other.get_x(1);
		} else {
			assert(false);
		}
		return other.c * point(a, b).length() == c * point(other.a, other.b).length();
	}
	
	void move(point dp) {
		// cout << dp << nl;
		// double new_y = (-c / b) + dp.y;
		// c = -new_y * b;

		// double new_x = (-c / a) + dp.x;
		// c = -new_x * a;
		// cout << *this << nl;
		// assert(!eq(b));

		point inline_p1;
		point inline_p2;
		if (!eq(b)) {
			assert(!eq(b));
			inline_p1 = point(0, get_y(0));
			inline_p2 = point(1, get_y(1));
		} else {
			assert(!eq(a));
			inline_p1 = point(get_x(0), 0);
			inline_p2 = point(get_x(1), 1);
		}
		inline_p1 += dp;
		inline_p2 += dp;
		set_abc(inline_p1, inline_p2);
	}


	friend ostream &operator<<(ostream &os, line &l) {
		os << l.a << " " << l.b << " " << l.c;
		return os;
	}

	friend istream &operator>>(istream &is, line &l) {
		is >> l.a >> l.b >> l.c;
		return is;
	}
};

class segment {
public:
	point first, second;

	segment() {}
	
	segment(point _first, point _second): first(_first), second(_second) {}

	double distance(point p) {
		double cos1 = ((first - second) * (p - second)) / ((first - second).length() * (p - second).length());
		double cos2 = ((second - first) * (p - first)) / ((second - first).length() * (p - first).length());
		// cout << cos1 << " " << cos2 << nl;
		if (cos1 >= 0 && cos2 >= 0) {
			return (line(first, second)).distance(p);
		} else {
			return min((first - p).length(), (second - p).length());
		}
	}

	bool in_segment(point p) {
		// cout << abs((first - second).length() -
		// 	(first - p).length() + (second - p).length());
		return abs((first - second).length() -
			(first - p).length() - (second - p).length()) < EPS;
	}

	bool intersect(segment s) {
		point p = line(s.first, s.second).intersect(line(first, second));
		return this->in_segment(p) && s.in_segment(p);
	}

	friend istream&operator>>(istream &is, segment &s) {
		is >> s.first >> s.second;
		return is;
	}
};

class circle {
public:
	double radius;
	point center;


	circle() {}
	circle(point _center, double _radius): center(_center), radius(_radius) {}
	

	double equate(point p) {
		// p = p - center;
		double x = p.x;
		double y = p.y;
		return x * x + y * y - radius * radius;
	}

	vector<point> tangent(point p) {
		assert(radius > 0);
		p -= center;
		if (p.length() < radius) {
			// cout << p.length() << nl;
			// assert(false);
			return vector<point>();
		}
		if (p.length() == radius) {
			vector<point> rez;
			rez.push_back(p + center);
			return rez;
		}
		vector<point> rez;
		// cout << radius << " : " << p.length() << nl;
		double tgp_len = sqrt(p.length() * p.length() - radius * radius);
		double alpha = asin(radius / p.length());
		// cout << tgp_len << " " << p.length() << nl;
		// cout << to_degrees(alpha) << nl;
		point sub_center = point(p.x, p.y);
		point inter;
		inter.set_polar(sub_center.angle() + alpha, tgp_len);
		// cout << inter << nl;
		rez.push_back(p - inter + center);
		inter.set_polar(sub_center.angle() - alpha, tgp_len);
		rez.push_back(p - inter + center);
		return rez;
	}

	vector<point> intersects_with_equasion(line l) {
		l.move(center.invert());
		// cout << l << nl;
		double a = l.b * l.b + l.a * l.a;
		double b = 2 * l.b * l.c;
		double c = l.c * l.c - l.a * l.a * radius * radius;
		double descr = b * b - 4 * a * c;
		if (descr < 0) return {};
		double root1 = (-b + sqrt(descr)) / (2 * a);
		double root2 = (-b - sqrt(descr)) / (2 * a);
		vector<point> rez;
		auto check_root = [&rez, l, descr](double root, circle _circle){
			double x = sqrt(_circle.radius * _circle.radius - root * root);
			double y = root;
			x = (-l.b * y - l.c) / l.a;
			// cout << x << " " << y << nl;
			double in_equate1 = x * x + y * y;
			double in_equate1_rez = _circle.radius * _circle.radius;
			// cout << t << " " << t2 << " " << " " << eq(t, t2) << endl;
			// cout << l.equate(point(x, y)) << endl;
			if (eq(_circle.equate(point(x, y))) && 
				eq(l.equate(point(x, y)))) {
				rez.push_back(_circle.center + 
					point(x, y));
			}
		};

		check_root(root1, *this);
		check_root(root2, *this);
		if (rez.size() > 1) {
			if (eq(rez[0].x, rez[1].x) && eq(rez[0].y, rez[1].y)) {
				rez.ppb();
			}
		}
		return rez;
	}

	vector<point> intersects(line l) {
		l.move(center.invert());
		double min_dist = l.distance(point(0, 0));
		point pt_normal(l.a, l.b);
		pt_normal /= pt_normal.length();
		pt_normal *= min_dist;
		if (!eq(l.equate(pt_normal))) {
			pt_normal = pt_normal.invert();
		}
		if (pt_normal.length() > radius) {
			return {};
		}
		if (eq(min_dist, radius)) {
			return {center + pt_normal};
		}
		double d = sqrt(radius * radius - min_dist * min_dist);
		point inline_pt(-l.b, l.a);
		inline_pt.set_length(d);
		vector<point> rez;
		rez.push_back(center + pt_normal + inline_pt);
		rez.push_back(center + pt_normal - inline_pt);
		return rez;
	}

	vector<point> intersects(circle c) {
		double betw_dist = (center - c.center).length();
		
		if (c.center == center && radius == c.radius)
			throw "To More Intersections";

		if (betw_dist > c.radius + radius)
			return {};

		if (betw_dist + radius < c.radius)
			return {};

		if (betw_dist + c.radius < radius) 
			return {};

		if (eq(betw_dist + c.radius, radius)) {
			point pt(c.center - center);
			pt.set_length(pt.length() + c.radius);
			return {center + pt};
		}

		if (eq(betw_dist + radius, c.radius)) {
			point pt(center - c.center);
			pt.set_length(pt.length() + radius);
			return {c.center + pt};
		}

		if (eq(betw_dist, c.radius + radius)) {
			point pt(c.center - center);
			pt.set_length(radius);
			return {center + pt};
		}
		double cx = c.radius;
		double b = (c.center - center).length();
		double a = radius;
		double alpha = (a * a + b * b - cx * cx) / (2 * a * b);
		double d = radius * alpha;
		double norm_d = sqrt(radius * radius - d * d);
		// cout << a << " " << b << " " << cx << nl;
		// cout << d << nl;
		point pt = c.center - center;
		pt.set_length(d);
		point norm_pt = pt.rotate90();
		norm_pt.set_length(norm_d);
		vector<point> rez;
		rez.pb(center + pt + norm_pt);
		rez.pb(center + pt - norm_pt);
		if (eq(rez[0].x, rez[1].x) && eq(rez[0].y, rez[1].y)) {
			rez.ppb();
		}
		return rez;
	}

	friend istream &operator>>(istream &is, circle &c) {
		is >> c.center >> c.radius;
		return is;
	}
};

template<class T>
T get_value_factor(T x) {
	if (x > (T)0) {
		return (T)1;
	} elif(x < (T)0) {
		return (T)-1;
	}
	return (T)0;
}

class polygon {
public:
	vector<point> points;
	
	polygon(vector<point> _points):points(_points) {}

	bool in_side(point p) {
		double sangle = 0;
		for (int i = 0; i < len(points); i++) {
			point f = points[i];
			point s = points[(i + 1) % len(points)];
			
			segment sg(f, s);
			if (sg.in_segment(p)) return true;
			point subf = (f - p);
			point subs = (s - p);
			double angle = atan2(subf ^ subs, subf * subs);
			// print to_degrees(angle);
			sangle += angle;
		}
		return abs(sangle) > (M_PI / 2);
	}

	bool in_side_with_ray(point p) {
		point magic_point(123456, 666666);
		// point magic_point(4, 2);
		segment s(p, magic_point);
		int cnt = 0;
		for (int i = 0; i < points.size(); i++) {
			segment edge(points[i], points[(i + 1) % points.size()]);
			if (edge.in_segment(p)) {
				return true;
			}
			cnt += edge.intersect(s);
		}
		// cout << cnt << nl;
		return cnt & 1;
	}

	bool is_convex() {
		int n = points.size();
		double last_turn = 0;
		for (int i = 0; i < n; i++) {
			point p1 = points[i];
			point p2 = points[(i + 1) % n];
			point p3 = points[(i + 2) % n];
			point p = p1 - p2;
			point q = p3 - p2;
			double sin_alpha = (p ^ q) / (p.length() * q.length());
			if (last_turn == 0) {
				last_turn = get_value_factor(sin_alpha);
				continue;
			}
			if (last_turn != get_value_factor(sin_alpha)) {
				return false;
			}
		}
		return true;
	}

	double square() {
		double sq = 0;
		for (int i = 0; i < points.size(); i++) {
			point first = points[i];
			point second = points[(i + 1) % points.size()];
			double w = second.x - first.x;
			double up_h = second.y - first.y;
			sq += w * first.y + (w * up_h / 2);
		}
		return abs(sq);
	};
};

line create_line_with_normal(point norm, point p_in_line) {
	double a = norm.x;
	double b = norm.y;
	double c = -(a * p_in_line.x + b * p_in_line.y);
	return line(a, b, c);
}



vector<point> convex_hull(vector<point> points, int kostil_id = 8) {
	point down = points[0];
	int n = points.size();
	if (n == 1) {
		return vector<point>{points[0]};
	}
	int down_ind = 0;
	for (int i = 1; i < n; i++) {
		point p = points[i];
		if (p.y == down.y) {
			if (p.x > down.x) {
				down = p;
				down_ind = i;
			}
		} elif(p.y < down.y) {
			down = p;
			down_ind = i;
		}
	}
	tie(points[down_ind], points[n - 1]) 
		= mt(points[n - 1], points[down_ind]);
	points.ppb();
	// cout << points << ":\n";
	for (auto x : points) {
		// cout << (x - down).angle() << " ";
	}
	// cout << "::\n";
	// cout << down << "::\n";
	// cout << "NL\n";
	// cout << points << ":\n";
	n = points.size();
	sort(points.begin(), points.end(), [&down, &kostil_id](point a, point b){
		point p = a - down;
		point q = b - down;
		if (p.angle() == q.angle()) {
			// cout << "applyied\n";
			// if (kostil_id == 5) {
			// 	return p.length() < q.length();
			// }
			return p.length() < q.length();
		}
		return p.angle() < q.angle();
	});
	// cout << points << nl;
	vector<point> rez;
	rez.pb(down);
	rez.pb(points[0]);
	// cout << "down: ";
	// cout << down << nl;
	for (int i = 1; i < n; i++) {
		bool need_iter = true;

		need_iter = true;
		point p1 = rez[rez.size() - 2], p2 = rez[rez.size() - 1];
		point p = p1 - p2;
		point q = points[i] - p2;
		// cout << p1 << " " << p2 << " " << points[i] << nl;
		while (((rez.size() >= 2)) && (p ^ q) >= 0) {
			// cout << (p ^ q) << endl;
			rez.ppb();
			p1 = rez[rez.size() - 2], p2 = rez[rez.size() - 1];
			p = p1 - p2;
			q = points[i] - p2;
		}

		rez.pb(points[i]);
	}
	point p1 = rez[rez.size() - 2], p2 = rez[rez.size() - 1];
	point p = p1 - p2;
	point q = down - p2;
	while ((rez.size() >= 3) && (p ^ q) >= 0) {
		rez.ppb();
		p1 = rez[rez.size() - 2], p2 = rez[rez.size() - 1];
		p = p1 - p2;
		q = down - p2;
	}
	return rez;
}
} // namespace geo


using namespace geo;

signed main(signed argc, char *argv[]) {
	// print line(point(-2, 0), point(-1, 0)).equal(line(point(0, 0), point(3, 0)));
	// return 0;
	int n;
	scan n;
	point cap_low;
	point cap_high;
	double x, y;
	scan x, y;
	cap_low = point(x, y);
	scan x, y;
	cap_high = point(x, y);

	assert(!(cap_low.x == cap_high.x && cap_low.y == cap_high.y));

	vector<point> starts(n);
	vector<point> speed(n);
	for (int i = 0; i < n; i++) {
		scan x, y;
		starts[i] = point(x, y);
		scan x, y;
		speed[i] = point(x, y);
	}

	vector<segment> sides;
	sides.pb(segment(cap_low, point(cap_low.x, cap_high.y)));
	sides.pb(segment(point(cap_low.x, cap_high.y), cap_high));
	sides.pb(segment(cap_high, point(cap_high.x, cap_low.y)));
	sides.pb(segment(cap_low, point(cap_high.x, cap_low.y)));

	double min_time = -1e9, max_time = 1e9;
	for (int i = 0; i < n; i++) {
		line l(starts[i], starts[i] + speed[i]);
		double _sub_min = 1e9;
		double _sub_max = -1e9;
		bool some_inters = false;

		bool two_factor = false;
		for (segment s : sides) {
			line sub(s.first, s.second);
			if (l.parallel(sub)) {
				if (l.equal(sub)) {
					two_factor = true;
				}
				continue;
			}
			point inter = l.intersect(sub);
			if (s.in_segment(inter)) {
				double dist = (inter - starts[i]).length();
				double time = dist / speed[i].length();
				_sub_min = min(_sub_min, time);
				_sub_max = max(_sub_max, time);
				some_inters = true;
			}
		}
		if (!some_inters || _sub_min == _sub_max || two_factor) {
			print -1;
			return 0;
		} else {
			min_time = max(min_time, _sub_min);
			max_time = min(max_time, _sub_max);
		}
	}

	if (min_time > max_time) {
		print -1;
		return 0;
	}
	print min_time;

}