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;
double PI = acos(-1);
struct point {
  double x, y;
  int cs;
  point(double x = 0, double y = 0) {
    this->x = x;
    this->y = y;
  }
  bool operator==(point& p) { return p.x == x && p.y == y; }
  bool operator<(const point& p) const {
    if (y == p.y) return x < p.x;
    return y < p.y;
  }
  point rotate(double alpha) {
    return point(x * cos(alpha) - y * sin(alpha),
                 x * sin(alpha) + y * cos(alpha));
  }
} botLeft, topRight;
struct line {
  double a, b, c;
  point A, B;
  line(double a, double b, double c) : a(a), b(b), c(c) {}
  line(point A, point B) : A(A), B(B) {
    a = B.y - A.y;
    b = A.x - B.x;
    c = -(a * A.x + b * A.y);
  }
  line(point P, double m) {
    a = -m;
    b = 1;
    c = -((a * P.x) + (b * P.y));
  }
  double f(point A) { return a * A.x + b * A.y + c; }
};
vector<line> a;
vector<point> g[100010];
vector<point> P;
struct vecto {
  double x, y;
  vecto(double x = 0, double y = 0) {
    this->x = x;
    this->y = y;
  }
  bool operator==(vecto& v) { return v.x == x && v.y == y; }
  bool operator<(const vecto& v) const {
    if (v.x == x) return y < v.y;
    return x < v.x;
  }
};
vecto toVec(point a, point b) { return vecto(b.x - a.x, b.y - a.y); }
double crossProduct(vecto a, vecto b) { return a.x * b.y - a.y * b.x; }
long long dotProduct(vecto a, vecto b) { return a.x * b.x + a.y * b.y; }
long long dist(point a, point b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
double DEG_to_RAD(double d) { return d * PI / 180.0; }
double RAD_to_DEG(double r) { return r * 180.0 / PI; }
inline int cmp(double a, double b) {
  return (a < b - 1e-9) ? -1 : ((a > b + 1e-9) ? 1 : 0);
}
bool areParallel(line l1, line l2) {
  return cmp(l1.a * l2.b, l1.b * l2.a) == 0;
}
bool areIntersect(line l1, line l2, point& p) {
  if (areParallel(l1, l2)) return false;
  double dx = l1.b * l2.c - l2.b * l1.c;
  double dy = l1.c * l2.a - l2.c * l1.a;
  double d = l1.a * l2.b - l2.a * l1.b;
  p = point(dx / d, dy / d);
  return true;
}
bool check(point P, line l) {
  vecto a = toVec(l.A, l.B);
  vecto b = toVec(l.A, P);
  return (a.x * b.x >= 0 && a.y * b.y >= 0);
}
bool isOneSide(line L) {
  bool isNeg = false, isPos = false;
  for (int i = (0); i <= (int((P).size()) - 1); i++) {
    point A = P[i];
    double k = crossProduct(toVec(L.A, L.B), toVec(L.A, A));
    if (k < 0) isNeg = true;
    if (k > 0) isPos = true;
  }
  if (!isNeg) return true;
  if (!isPos) return true;
  return false;
}
bool always[100010];
bool solve(int I, line L) {
  if (always[I]) return true;
  if (isOneSide(L)) return false;
  for (int i = (0); i <= (int((P).size()) - 1); i++) {
    point A = P[i], B = P[(i + 1) % int((P).size())];
    if (crossProduct(toVec(L.A, L.B), toVec(L.A, A)) == 0) {
      if (!check(A, L)) continue;
      g[I].push_back(A);
      continue;
    }
    if (crossProduct(toVec(L.A, L.B), toVec(L.A, A)) *
            crossProduct(toVec(L.A, L.B), toVec(L.A, B)) <
        0) {
      point p;
      areIntersect(line(A, B), L, p);
      if (!check(p, L)) continue;
      g[I].push_back(p);
    }
  }
  if (int((g[I]).size()) == 0) return false;
  if (int((g[I]).size()) == 1)
    if (!(L.A.x < topRight.x && L.A.x > botLeft.x && L.A.y < topRight.y &&
          L.A.y > botLeft.y))
      return false;
  return true;
}
bool f[100010];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  cin >> botLeft.x >> botLeft.y >> topRight.x >> topRight.y;
  P.push_back(botLeft);
  P.push_back(point(botLeft.x, topRight.y));
  P.push_back(topRight);
  P.push_back(point(topRight.x, botLeft.y));
  for (int i = (1); i <= (n); i++) {
    point p;
    cin >> p.x >> p.y;
    point v;
    cin >> v.x >> v.y;
    if (0 == v.x && 0 == v.y) {
      a.push_back(line(point(0, 0), point(1, 1)));
      if (p.x < topRight.x && p.x > botLeft.x && p.y < topRight.y &&
          p.y > botLeft.y)
        always[i - 1] = true;
      else {
        cout << -1;
        return 0;
      }
      continue;
    }
    v.x += p.x;
    v.y += p.y;
    a.push_back(line(p, v));
  }
  if (topRight.x == botLeft.x || topRight.y == botLeft.y) {
    cout << -1;
    return 0;
  }
  for (int i = (0); i <= (n - 1); i++)
    if (!solve(i, a[i])) {
      cout << -1;
      return 0;
    }
  for (int i = (0); i <= (n - 1); i++)
    if (int((g[i]).size()) == 1) {
      f[i] = true;
      g[i].push_back(a[i].A);
    }
  double lef = 0;
  double rig = 1000000000;
  for (int i = (0); i <= (n - 1); i++) {
    if (always[i]) continue;
    double u, t1, t2;
    if (a[i].B.x == a[i].A.x) {
      u = g[i][0].y - a[i].A.y;
      t1 = u / (a[i].B.y - a[i].A.y);
      u = g[i][1].y - a[i].A.y;
      t2 = u / (a[i].B.y - a[i].A.y);
    } else {
      u = g[i][0].x - a[i].A.x;
      t1 = u / (a[i].B.x - a[i].A.x);
      u = g[i][1].x - a[i].A.x;
      t2 = u / (a[i].B.x - a[i].A.x);
    }
    if (t1 > t2) swap(t1, t2);
    if (!f[i]) t1 += 1e-15;
    if (t2 != 0) t2 -= 1e-15;
    if (t1 > rig || t2 < lef) {
      cout << -1 << endl;
      return 0;
    }
    lef = max(lef, t1);
    rig = min(rig, t2);
  }
  cout << fixed << setprecision(9) << lef;
  return 0;
}