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;
struct line {
  double a, b, c;
};
pair<double, double> toVec(pair<double, double> a, pair<double, double> b) {
  return pair<double, double>(b.first - a.first, b.second - a.second);
}
pair<double, double> scale(pair<double, double> a, double s) {
  return pair<double, double>(a.first * s, a.second * s);
}
pair<double, double> translate(pair<double, double> p, pair<double, double> t) {
  return pair<double, double>(p.first + t.first, p.second + t.second);
}
double dot(pair<double, double> a, pair<double, double> b) {
  return a.first * b.first + a.second * b.second;
}
double norm_sq(pair<double, double> a) {
  return a.first * a.first + a.second * a.second;
}
double dist(pair<double, double> a, pair<double, double> b) {
  return hypot(a.first - b.first, a.second - b.second);
}
double distToLine(pair<double, double> p, pair<double, double> a,
                  pair<double, double> b, pair<double, double> &c) {
  pair<double, double> ap = toVec(a, p), ab = toVec(a, b);
  double u = dot(ap, ab) / norm_sq(ab);
  c = translate(a, scale(ab, u));
  return dist(p, c);
}
double distToLineSegment(pair<double, double> p, pair<double, double> a,
                         pair<double, double> b, pair<double, double> &c) {
  pair<double, double> ap = toVec(a, p), ab = toVec(a, b);
  double u = dot(ap, ab) / norm_sq(ab);
  if (u < 0.0) {
    c = pair<double, double>(a.first, a.second);
    return dist(p, a);
  }
  if (u > 1.0) {
    c = pair<double, double>(b.first, b.second);
    return dist(p, b);
  }
  return distToLine(p, a, b, c);
}
void ptl(pair<double, double> p1, pair<double, double> p2, line &l1) {
  if (fabs(p1.first - p2.first) < 0.000000000001) {
    l1.a = 1.0;
    l1.b = 0.0;
    l1.c = -p1.first;
  } else {
    l1.a = -(double)(p1.second - p2.second) / (p1.first - p2.first);
    l1.b = 1.0;
    l1.c = -(double)(l1.a * p1.first) - p1.second;
  }
}
bool paralell(line l1, line l2) {
  return fabs(l1.a - l2.a) < 0.000000000001 &&
         fabs(l1.b - l2.b) < 0.000000000001;
}
bool same(line l1, line l2) {
  return (paralell(l1, l2) && fabs(l1.c - l2.c) < 0.000000000001);
}
void intersect(line l1, line l2, pair<double, double> &ans) {
  if (paralell(l1, l2)) {
    ans = pair<double, double>(-1e9, -1e9);
    return;
  }
  ans.first = (l2.b * l1.c - l1.b * l2.c) / (l2.a * l1.b - l1.a * l2.b);
  if (fabs(l1.b) > 0.000000000001)
    ans.second = -(l1.a * ans.first + l1.c);
  else
    ans.second = -(l2.a * ans.first + l2.c);
}
bool inside(pair<double, double> a, pair<double, double> b,
            pair<double, double> p) {
  if (a > b) swap(a, b);
  double minx = min(a.first, b.first), maxx = max(a.first, b.first),
         miny = min(a.second, b.second), maxy = max(a.second, b.second);
  bool ans = (p.first >= minx && p.first <= maxx && p.second >= miny &&
              p.second <= maxy);
  return ans;
}
bool inside_square(pair<double, double> a, pair<double, double> b,
                   pair<double, double> p) {
  double minx = min(a.first, b.first), maxx = max(a.first, b.first),
         miny = min(a.second, b.second), maxy = max(a.second, b.second);
  if (p.first > minx && p.first < maxx && p.second > miny && p.second < maxy)
    return true;
  return false;
}
int main() {
  int n;
  scanf("%d", &n);
  int x1, y1, x2, y2;
  scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
  if (x1 > x2) swap(x1, x2);
  if (y1 > y2) swap(y1, y2);
  if (x1 == x2 || y1 == y2) {
    printf("-1\n");
    return 0;
  }
  vector<pair<double, double> > events;
  for (int i = int(0); i < (int)n; ++i) {
    int a, b, dx, dy;
    scanf("%d %d %d %d", &a, &b, &dx, &dy);
    double sx, fx, sy, fy;
    if (a > x1 && a < x2) {
      sx = 0.0;
      if (dx < 0)
        fx = abs(a - x1) / (double)abs(dx);
      else if (dx > 0)
        fx = abs(a - x2) / (double)abs(dx);
      else
        fx = 1e15;
    } else {
      if (dx) {
        if (a <= x1) {
          if (dx < 0) {
            printf("-1\n");
            return 0;
          }
          sx = abs(a - x1) / (double)abs(dx) + 0.000000000001;
          fx = abs(a - x2) / (double)abs(dx);
        } else if (a >= x2) {
          if (dx > 0) {
            printf("-1\n");
            return 0;
          }
          sx = abs(a - x2) / (double)abs(dx) + 0.000000000001;
          fx = abs(a - x1) / (double)abs(dx);
        }
      } else {
        printf("-1\n");
        return 0;
      }
    }
    if (b > y1 && b < y2) {
      sy = 0.0;
      if (dy < 0)
        fy = abs(b - y1) / (double)abs(dy);
      else if (dy > 0)
        fy = abs(b - y2) / (double)abs(dy);
      else
        fy = 1e15;
    } else {
      if (dy) {
        if (b <= y1) {
          if (dy < 0) {
            printf("-1\n");
            return 0;
          }
          sy = abs(b - y1) / (double)abs(dy) + 0.000000000001;
          fy = abs(b - y2) / (double)abs(dy);
        } else if (b >= y2) {
          if (dy > 0) {
            printf("-1\n");
            return 0;
          }
          sy = abs(b - y2) / (double)abs(dy) + 0.000000000001;
          fy = abs(b - y1) / (double)abs(dy);
        }
      } else {
        printf("-1\n");
        return 0;
      }
    }
    events.push_back(pair<double, double>(max(sx, sy), 0));
    events.push_back(pair<double, double>(min(fx, fy), 1));
  }
  sort(events.begin(), events.end());
  int cnt = 0;
  double ans = -1;
  double tmp = 0;
  for (int i = int(0); i < (int)events.size(); ++i) {
    if (cnt == n) {
      ans = tmp;
      break;
    }
    if (events[i].second == 0) {
      tmp = max(tmp, events[i].first);
      cnt++;
    } else {
      cnt--;
    }
  }
  if (cnt == n) {
    ans = tmp;
  }
  printf("%.12lf\n", ans);
  return 0;
}