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.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (PloadyFree@gmail.com)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        private Rect start;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            Point[] pos = new Point[n];
            Vector[] dir = new Vector[n];
            start = Rect.create(in.readInt(), in.readInt(), in.readInt(), in.readInt());
            for (int i = 0; i < n; i++) {
                pos[i] = new Point(in.readInt(), in.readInt());
                dir[i] = new Vector(in.readInt(), in.readInt());
            }
            double minTime = 0;
            for (int i = 0; i < n; i++) {
                double t = minTime(pos[i], dir[i]);
                if (t == -1) {
                    out.print(-1);
                    return;
                }
                minTime = Math.max(minTime, t);
            }
            minTime += 1e-10;
            for (int i = 0; i < n; i++) {
                Point p = pos[i];
                Vector d = dir[i];
                if (!start.inside(p.apply(d, minTime))) {
                    out.print(-1);
                    return;
                }
            }
            out.printFormat("%.20f", minTime);
        }

        private double minTime(Point p, Vector dir) {
            if (start.inside(p)) {
                return 0;
            }
            if (start.onside(p)) {
                if (start.inside(p.apply(dir, 1e-10))) {
                    return 0;
                }
                return -1;
            }

            double l = 0;
            double r = 1e9;
            for (int i = 0; i < 150; i++) {
                double m1 = l + (r - l) / 3;
                double m2 = r - (r - l) / 3;
                double d1 = start.dist(p.apply(dir, m1));
                double d2 = start.dist(p.apply(dir, m2));
                if (d1 > d2) {
                    l = m1;
                } else {
                    r = m2;
                }
            }

            p = p.apply(dir, l);
            return start.dist(p) < 1e-10 && start.inside(p.apply(dir, 1e-10))
                    ? l
                    : -1;
        }

    }

    static class Vector {
        public final double x;
        public final double y;
        public final Point point;

        public Vector(double x, double y) {
            this.x = x;
            this.y = y;
            point = new Point(x, y);
        }

        public Vector(Point point) {
            this.x = point.x;
            this.y = point.y;
            this.point = point;
        }

        public Vector(Point from, Point to) {
            this(to.x - from.x, to.y - from.y);
        }

    }

    static class Segment {
        public final Point a;
        public final Point b;
        private double distance = Double.NaN;
        private Line line = null;

        public Segment(Point a, Point b) {
            this.a = a;
            this.b = b;
        }

        public double length() {
            if (Double.isNaN(distance)) {
                distance = a.distance(b);
            }
            return distance;
        }

        public double distance(Point point) {
            double length = length();
            double left = point.distance(a);
            if (length < GeometryUtils.epsilon) {
                return left;
            }
            double right = point.distance(b);
            if (left * left > right * right + length * length) {
                return right;
            }
            if (right * right > left * left + length * length) {
                return left;
            }
            return point.distance(line());
        }

        public Line line() {
            if (line == null) {
                line = a.line(b);
            }
            return line;
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class Rect {
        public int x0;
        public int x1;
        public int y0;
        public int y1;
        public Segment top;
        public Segment bot;
        public Segment left;
        public Segment right;

        public Rect(int x0, int y0, int x1, int y1) {
            this.x0 = x0;
            this.y0 = y0;
            this.x1 = x1;
            this.y1 = y1;
            Point a = new Point(x0, y0);
            Point b = new Point(x1, y0);
            Point c = new Point(x1, y1);
            Point d = new Point(x0, y1);
            top = new Segment(c, d);
            bot = new Segment(a, b);
            left = new Segment(a, d);
            right = new Segment(b, c);
        }

        public static Rect create(int x0, int y0, int x1, int y1) {
            if (x0 > x1) {
                return create(x1, y0, x0, y1);
            }
            if (y0 > y1) {
                return create(x0, y1, x1, y0);
            }
            return new Rect(x0, y0, x1, y1);
        }

        public boolean onside(Point p) {
            return !inside(p) &&
                    x0 <= p.x && p.x <= x1 &&
                    y0 <= p.y && p.y <= y1;
        }

        public boolean inside(Point p) {
            return x0 < p.x && p.x < x1 &&
                    y0 < p.y && p.y < y1;
        }

        public double dist(Point p) {
            return inside(p) ? 0 : Math.min(
                    Math.min(top.distance(p), bot.distance(p)),
                    Math.min(left.distance(p), right.distance(p)));
        }

    }

    static class Point {
        public final double x;
        public final double y;


        public String toString() {
            return "(" + x + ", " + y + ")";
        }

        public Point(double x, double y) {
            this.x = x;
            this.y = y;
        }

        public Line line(Point other) {
            if (equals(other)) {
                return null;
            }
            double a = other.y - y;
            double b = x - other.x;
            double c = -a * x - b * y;
            return new Line(a, b, c);
        }


        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }

            Point point = (Point) o;

            return Math.abs(x - point.x) <= GeometryUtils.epsilon && Math.abs(y - point.y) <= GeometryUtils.epsilon;
        }


        public int hashCode() {
            int result;
            long temp;
            temp = x != +0.0d ? Double.doubleToLongBits(x) : 0L;
            result = (int) (temp ^ (temp >>> 32));
            temp = y != +0.0d ? Double.doubleToLongBits(y) : 0L;
            result = 31 * result + (int) (temp ^ (temp >>> 32));
            return result;
        }

        public double distance(Point other) {
            return GeometryUtils.fastHypot(x - other.x, y - other.y);
        }

        public double distance(Line line) {
            return Math.abs(line.a * x + line.b * y + line.c);
        }

        public Point apply(Vector vector, double ratio) {
            return new Point(x + vector.x * ratio, y + vector.y * ratio);
        }

    }

    static class GeometryUtils {
        public static double epsilon = 1e-8;

        public static double fastHypot(double x, double y) {
            return Math.sqrt(x * x + y * y);
        }

    }

    static class Line {
        public final double a;
        public final double b;
        public final double c;

        public Line(Point p, double angle) {
            a = Math.sin(angle);
            b = -Math.cos(angle);
            c = -p.x * a - p.y * b;
        }

        public Line(double a, double b, double c) {
            double h = GeometryUtils.fastHypot(a, b);
            this.a = a / h;
            this.b = b / h;
            this.c = c / h;
        }

        public boolean parallel(Line other) {
            return Math.abs(a * other.b - b * other.a) < GeometryUtils.epsilon;
        }


        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }

            Line line = (Line) o;

            if (!parallel(line)) {
                return false;
            }
            if (Math.abs(a * line.c - c * line.a) > GeometryUtils.epsilon ||
                    Math.abs(b * line.c - c * line.b) > GeometryUtils.epsilon) {
                return false;
            }

            return true;
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void printFormat(String format, Object... objects) {
            writer.printf(format, objects);
        }

        public void close() {
            writer.close();
        }

        public void print(int i) {
            writer.print(i);
        }

    }
}

