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 double INF = 1E200;
const double EP = 1E-13;
const int maxn = 200000;
const double PI = 3.14159265;
struct POINT {
  double x;
  double y;
  POINT(double a = 0, double b = 0) {
    x = a;
    y = b;
  }
};
struct LINESEG {
  POINT s;
  POINT e;
  LINESEG(POINT a, POINT b) {
    s = a;
    e = b;
  }
  LINESEG() {}
};
struct LINE {
  double a;
  double b;
  double c;
  LINE(double d1 = 1, double d2 = -1, double d3 = 0) {
    a = d1;
    b = d2;
    c = d3;
  }
};
struct node {
  double x;
  int flag;
  node() {}
  node(double _x, int _flag) {
    x = _x;
    flag = _flag;
  }
};
bool cmp1(POINT x, POINT y) {
  if (x.x == y.x) return x.y < y.y;
  return x.x < y.x;
}
POINT p[30], r[maxn], go[30];
LINESEG s[30];
node m[maxn * 2];
double x[maxn], y[maxn], vx[maxn], vy[maxn], ti[maxn][2], a[30];
int seg_seg(LINESEG l1, int targ, POINT &iter) {
  if (l1.e.x == l1.s.x) {
    double t = (l1.e.x - x[targ]) / vx[targ];
    if (t < 0) return 0;
    if (!vx[targ]) return 0;
    double hi = y[targ] + vy[targ] * t;
    if (hi >= min(l1.e.y, l1.s.y) && hi <= max(l1.e.y, l1.s.y)) {
      iter.x = l1.e.x;
      iter.y = hi;
      return 1;
    } else
      return 0;
  } else {
    double t = (l1.e.y - y[targ]) / vy[targ];
    if (t < 0) return 0;
    if (!vy[targ]) return 0;
    double hi = x[targ] + vx[targ] * t;
    if (hi >= min(l1.e.x, l1.s.x) && hi <= max(l1.e.x, l1.s.x)) {
      iter.x = hi;
      iter.y = l1.e.y;
      return 1;
    } else
      return 0;
  }
}
int check(LINESEG k, int targ) {
  int num = 0;
  if (x[targ] >= min(a[1], a[3]) && x[targ] <= max(a[1], a[3]) &&
      y[targ] >= min(a[2], a[4]) && y[targ] <= max(a[2], a[4])) {
    num = 1;
    go[1] = r[targ];
  }
  for (int i = 1; i <= 4; i++) {
    if (vx[targ] == 0)
      if (x[targ] == a[1] || x[targ] == a[3]) return 0;
    if (vy[targ] == 0)
      if (y[targ] == a[2] || y[targ] == a[4]) return 0;
    POINT tmp;
    if (seg_seg(s[i], targ, tmp)) {
      num++;
      go[num] = tmp;
    }
  }
  if (!num) return 0;
  int tot = 1;
  sort(go + 1, go + 1 + num, cmp1);
  for (int i = 2; i <= num; i++) {
    if (go[i].x != go[i - 1].x || go[i].y != go[i - 1].y) go[++tot] = go[i];
  }
  return tot == 2;
}
bool cmp(node x, node y) {
  if (x.x == y.x) return x.flag > y.flag;
  return x.x < y.x;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= 4; i++) scanf("%lf", &a[i]);
  p[1] = POINT(min(a[1], a[3]), min(a[2], a[4]));
  p[2] = POINT(max(a[1], a[3]), min(a[2], a[4]));
  p[3] = POINT(max(a[1], a[3]), max(a[2], a[4]));
  p[4] = POINT(min(a[1], a[3]), max(a[2], a[4]));
  s[1] = LINESEG(p[1], p[2]);
  s[2] = LINESEG(p[2], p[3]);
  s[3] = LINESEG(p[4], p[3]);
  s[4] = LINESEG(p[1], p[4]);
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf%lf%lf", &x[i], &y[i], &vx[i], &vy[i]);
    double nowx, nowy;
    nowx = x[i] + vx[i] * INF;
    nowy = y[i] + vy[i] * INF;
    r[i] = POINT(x[i], y[i]);
    POINT tmp1 = POINT(nowx, nowy);
    LINESEG z = LINESEG(tmp1, r[i]);
    if (!vx[i] && !vy[i]) {
      if (x[i] > min(a[1], a[3]) && x[i] < max(a[1], a[3]) &&
          y[i] > min(a[2], a[4]) && y[i] < max(a[2], a[4])) {
        ti[i][0] = 0;
        ti[i][1] = INF;
        continue;
      } else
        return 0 * printf("-1");
    }
    if (!check(z, i)) return 0 * printf("-1");
    if (vx[i]) {
      ti[i][0] = (go[1].x - x[i]) / vx[i];
      ti[i][1] = (go[2].x - x[i]) / vx[i];
    } else {
      ti[i][0] = (go[1].y - y[i]) / vy[i];
      ti[i][1] = (go[2].y - y[i]) / vy[i];
    }
    if (ti[i][0] > ti[i][1]) swap(ti[i][0], ti[i][1]);
    ti[i][0] += EP;
    ti[i][1] -= EP;
  }
  for (int i = 1; i <= n; i++) {
    m[i] = node(ti[i][0], 1);
    m[i + n] = node(ti[i][1], -1);
  }
  sort(m + 1, m + 1 + n * 2, cmp);
  int sum = 0;
  for (int i = 1; i <= 2 * n; i++) {
    sum += m[i].flag;
    if (sum == n) {
      printf("%.20lf", m[i].x);
      return 0;
    }
  }
  printf("-1");
  return 0;
}