Problem: 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 (x1, y1) and (x2, y2).

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 (vix, viy), that means that the x coordinate of the mouse increases by vix units per second, while the y coordinates increases by viy 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.

Input

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 x1, y1, x2 and y2 (0 ≤ x1 ≤ x2 ≤ 100 000), (0 ≤ y1 ≤ y2 ≤ 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 rix, riy, vix and viy, (0 ≤ rix, riy ≤ 100 000,  - 100 000 ≤ vix, viy ≤ 100 000), where (rix, riy) is the initial position of the mouse, and (vix, viy) is its speed.

Output

In the only line print minimum possible non-negative number t such that if Igor closes the mousetrap at t seconds from the beginning, then all the mice are strictly inside the mousetrap. If there is no such t, print -1.

Your answer is considered correct if its absolute or relative error doesn't exceed 10 - 6. 

Formally, let your answer be a, and the jury's answer be b. Your answer is considered correct if <image>.

Examples

Input

4
7 7 9 8
3 5 7 5
7 5 2 4
3 3 7 8
6 6 3 2


Output

0.57142857142857139685


Input

4
7 7 9 8
0 3 -5 4
5 0 5 4
9 9 -1 -6
10 5 -7 -10


Output

-1

Note

Here is a picture of the first sample

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

<image>

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

<image>

Here is a picture of the second sample

<image>

Points A, D, B will never enter rectangle.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int oo = 1000000007;
struct line {
  long double a, b, c;
  void make(const pair<long double, long double> &p1,
            const pair<long double, long double> &p2) {
    a = p2.second - p1.second;
    b = p1.first - p2.first;
    c = -a * p1.first - b * p1.second;
  }
};
long double n, x1, y_1, x2, y2, u1[100010], v1[100010], u2[100010], v2[100010],
    vx[100010], vy[100010], resl = 0, resr = oo;
pair<long double, long double> P1[5], P2[5], PP1[100010], PP2[100010];
vector<pair<long double, long double> > d[100010];
line L[5], l[100010];
pair<long double, long double> cut(const line &l1, const line &l2) {
  pair<long double, long double> p;
  long double tmpa = l2.c * l1.a - l1.c * l2.a,
              tmpb = l2.c * l1.b - l1.c * l2.b, tmp = l1.b * l2.a - l2.b * l1.a;
  if (abs(tmp) < 1e-10) {
    if (abs(tmpa) < 1e-10 && abs(tmpb) < 1e-10)
      return (make_pair(-2 * oo, -2 * oo));
    return (make_pair(-oo, -oo));
  }
  p.second = tmpa / tmp;
  if (abs(l1.a) >= 1e-10)
    p.first = (-l1.c - l1.b * p.second) / l1.a;
  else
    p.first = (-l2.c - l2.b * p.second) / l2.a;
  return p;
}
bool mid(pair<long double, long double> p1, pair<long double, long double> p2,
         pair<long double, long double> p3) {
  if (p2.first - p1.first >= 1e-10 && p2.first - p3.first >= 1e-10)
    return false;
  if (p2.second - p1.second >= 1e-10 && p2.second - p3.second >= 1e-10)
    return false;
  if (p1.first - p2.first >= 1e-10 && p3.first - p2.first >= 1e-10)
    return false;
  if (p1.second - p2.second >= 1e-10 && p3.second - p2.second >= 1e-10)
    return false;
  return true;
}
void nosol() {
  cout << "-1";
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> x1 >> y_1 >> x2 >> y2;
  P1[1] = make_pair(x1, y_1);
  P2[1] = make_pair(x1, y2);
  P1[2] = make_pair(x1, y_1);
  P2[2] = make_pair(x2, y_1);
  P1[3] = make_pair(x2, y2);
  P2[3] = make_pair(x1, y2);
  P1[4] = make_pair(x2, y2);
  P2[4] = make_pair(x2, y_1);
  for (int i = 1, _key = 4; i <= _key; ++i) L[i].make(P1[i], P2[i]);
  for (int i = 1, _key = n; i <= _key; ++i) {
    cin >> u1[i] >> v1[i] >> vx[i] >> vy[i];
    PP1[i] = make_pair(u1[i], v1[i]);
    u2[i] = u1[i] + (long long)oo * vx[i];
    v2[i] = v1[i] + (long long)oo * vy[i];
    PP2[i] = make_pair(u2[i], v2[i]);
    l[i].a = -vy[i];
    l[i].b = vx[i];
    l[i].c = -l[i].a * u1[i] - l[i].b * v1[i];
    long double tl = oo, tr = 0;
    if (u1[i] - x1 >= 1e-10 && x2 - u1[i] >= 1e-10 && v1[i] - y_1 >= 1e-10 &&
        y2 - v1[i] >= 1e-10)
      tl = 0;
    if (vx[i] == 0 && vy[i] == 0) {
      if (u1[i] - x1 >= 1e-10 && x2 - u1[i] >= 1e-10 && v1[i] - y_1 >= 1e-10 &&
          y2 - v1[i] >= 1e-10)
        continue;
      else
        nosol();
    }
    for (int j = 1, _key = 4; j <= _key; ++j) {
      pair<long double, long double> pp = cut(l[i], L[j]);
      if (abs(pp.first + 2 * oo) <= 1e-10 && abs(pp.second + 2 * oo) <= 1e-10)
        nosol();
      else if (abs(pp.first + oo) <= 1e-10 && abs(pp.second + oo) <= 1e-10)
        continue;
      else if (mid(P1[j], pp, P2[j]) && mid(PP1[i], pp, PP2[i]))
        d[i].push_back(pp);
      else
        continue;
    }
    if (d[i].empty()) nosol();
    for (int j = 0, _key = d[i].size(); j < _key; ++j) {
      long double dd = -1;
      if (vx[i] != 0) dd = max(dd, abs(d[i][j].first - u1[i]) / abs(vx[i]));
      if (vy[i] != 0) dd = max(dd, abs(d[i][j].second - v1[i]) / abs(vy[i]));
      tl = min(tl, dd);
      tr = max(tr, dd);
    }
    if (tl == tr) nosol();
    resl = max(resl, tl);
    resr = min(resr, tr);
  }
  cout.precision(15);
  cout << fixed;
  if (resl < resr)
    cout << resl;
  else
    cout << "-1";
}