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 JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class TinkoffC {
	static final double oo = 1e50;
	static final double EPS = 1e-11;
	public static void main(String[] args) {
		FS scan = new FS(System.in);
		int N = scan.nextInt();
		Vector[] rect = new Vector[4];
		rect[0] = new Vector(scan.nextInt(), scan.nextInt(), 0);
		rect[2] = new Vector(scan.nextInt(), scan.nextInt(), 0);
		rect[1] = new Vector(rect[0].x, rect[2].y, 0);
		rect[3] = new Vector(rect[2].x, rect[0].y, 0);
		
		Vector[] pos = new Vector[N], vel = new Vector[N];
		
		boolean valid = true;
		ArrayList<Event> list = new ArrayList<>();
		for(int i=0;i<N;i++){
			
			pos[i] = new Vector(scan.nextInt(), scan.nextInt(),0);
			vel[i] = new Vector(scan.nextInt(), scan.nextInt(),0);
			
			if(vel[i].x==0 && vel[i].y==0) {
				valid &= inRect(rect, pos[i]);
				list.add(new Event(0,0));
				continue;
			}
			
			Line V = new Line(pos[i], new Vector(pos[i].x+vel[i].x, pos[i].y+vel[i].y,0));
			
			double lo = oo, hi = -oo;
			ArrayList<Vector> ints = new ArrayList<>();
			for(int j=1;j<=4;j++){
				Line l = new Line(rect[j-1], rect[j%4]);
				Vector inter = V.lineIntersect2D(l);
				if(inter==null)continue;
					
				if(j==1 || j==3) {
					if(inter.y+EPS < Math.min(rect[j%4].y, rect[j-1].y) ||
							inter.y-EPS > Math.max(rect[j%4].y, rect[j-1].y))continue;
				}else{
					if(inter.x+EPS < Math.min(rect[j%4].x, rect[j-1].x) ||
							inter.x-EPS > Math.max(rect[j%4].x, rect[j-1].x))continue;
				}
				
				Vector dir = new Vector(inter.x-pos[i].x, inter.y-pos[i].y,0);
				double time = dir.mag() / vel[i].mag();
				
				ints.add(inter);
				if(dir.dot(vel[i]) < 0)continue;
				
				lo = Math.min(time, lo);
				hi = Math.max(time, hi);
			}
			if(ints.size()==2 && isEdge(rect, ints))valid=false;
			if(Math.abs(hi-lo)<=EPS && inRect(rect,pos[i])){
				list.add( new Event(0,0));
				list.add(new Event(lo,1));
				continue;
			}
			else if (Math.abs(hi-lo)<=EPS){
				valid=false;
			}
			list.add( new Event(lo, 0));
			list.add( new Event(hi, 1));
		}
		Collections.sort(list);
		int count = 0;
		double sol = oo;
		for(Event e : list) {
			if(e.type==0){
				count++;
			}else{
				count--;
			}
			
			if(count==N){
				sol = e.time;
				break;
			}
		}
		System.out.println((!valid || sol==oo)?"-1":sol);
	}
	private static boolean isEdge(Vector[] rect, ArrayList<Vector> ints) {

		for(int i=1;i<=4;i++){
			double d1 = rect[i%4].add(ints.get(1).neg()).mag(),
				   d2 = rect[i-1].add(ints.get(0).neg()).mag(),
				   d3 = rect[i%4].add(ints.get(0).neg()).mag(),
				   d4 = rect[i-1].add(ints.get(1).neg()).mag();
			
			if(d1+d2 <= EPS || d3+d4<=EPS)return true;
		}
		
		return false;
	}
	private static class Event implements Comparable<Event> {
		double time;
		int type;
		public Event(double time, int type) {
			this.time = time;
			this.type = type;
		}
		
		public int compareTo(Event e) {
			if(Math.abs(time-e.time)<=EPS){
				if(type==e.type)return 0;
				else if (type == 0 && e.type==1)return 1;
				else return -1;
			}	
			return Double.compare(time, e.time);
		}
	}
	private static boolean inRect(Vector[] rect, Vector p) {
		long area = (long)(rect[2].x - rect[0].x) * (long)(rect[2].y-rect[0].y);
		
		long sum = 0;
		for(int i=1;i<=4;i++){
			if(p.x==rect[i%4].x || p.y == rect[i%4].y)return false;
			Vector v1 = new Vector(rect[i%4].x-p.x, rect[i%4].y-p.y,0);
			Vector v2 = new Vector(rect[i-1].x-p.x, rect[i-1].y-p.y,0);
			sum+=(long)v1.cross(v2).mag();
		}
		
		return Math.abs(sum)/2 == area;
	}
	private static class Line {
		Vector p1, p2, dir;
		public Line(Vector p1, Vector p2) {
			this.p1 = p1;
			this.p2 = p2;
			dir = new Vector(p2.x-p1.x,p2.y-p1.y,p2.z-p1.z);
		}
		public boolean isParallel(Line l) {
			return Math.abs(dir.x*l.dir.y-dir.y*l.dir.x)<=1e-7 &&
				   Math.abs(dir.y*l.dir.z-dir.z*l.dir.y)<=1e-7;
		}
		public Vector lineIntersect2D(Line v) {
			if(this.isParallel(v))return null;
			Vector vPerp = new Vector(-v.dir.y,v.dir.x,0),
				   w = this.p1.add(v.p1.neg()),
				   off = this.dir.mult((vPerp.neg()).dot(w)/vPerp.dot(this.dir));
			return vPerp.dot(this.dir)==0?null:this.p1.add(off);
		}
		public Vector lineIntersect3D(Line v) {
			Vector pA = new Vector(p1.x,p1.y,0), qA = new Vector(v.p1.x,v.p1.y,0), 
				   pB = new Vector(p1.x,p1.z,0), qB = new Vector(v.p1.x,v.p1.z,0),
				   pC = new Vector(p1.y,p1.z,0), qC = new Vector(v.p1.y,v.p1.z,0);
			Vector dpA = new Vector(dir.x,dir.y,0), dqA = new Vector(v.dir.x,v.dir.y,0),
				   dpB = new Vector(dir.x,dir.z,0), dqB = new Vector(v.dir.x,v.dir.z,0),
				   dpC = new Vector(dir.y,dir.z,0), dqC = new Vector(v.dir.y,v.dir.z,0);
			double x=0,y=0,z=0;
			Vector a = new Line(pA,pA.add(dpA)).lineIntersect2D(new Line(qA,qA.add(dqA))),
				   b = new Line(pB,pB.add(dpB)).lineIntersect2D(new Line(qB,qB.add(dqB))),
				   c = new Line(pC,pC.add(dpC)).lineIntersect2D(new Line(qC,qC.add(dqC)));
			if(a==null&&b==null&&c==null)return null;
			if(a!=null){x = a.x;y=a.y;}
			if(b!=null){x = b.x;z=b.y;}
			if(c!=null){y = c.x;z=c.y;}
			return new Vector(x,y,z);
		}
		public double lineDistance(Line v) {
			if(this.isParallel(v))return -1;
			Vector c = v.p1.add(this.p1.neg());
			return c.dot(this.dir.cross(v.dir))/this.dir.cross(v.dir).mag();
		}
		public double pointLineDist(Vector p) {
			double num = (p.add(p1.neg())).cross(p.add(p2.neg())).mag();
			return num/(p2.add(p1.neg())).mag();
		}
		
	}
	private static class Vector {
		double x,y,z;
		public Vector (double x, double y, double z) {
			this.x = x;
			this.y = y;
			this.z = z;
		}
		public Vector cross(Vector v) {
			double x = this.y*v.z-this.z*v.y,
				   y = this.z*v.x-this.x*v.z,
				   z = this.x*v.y-this.y*v.x;
			return new Vector(x,y,z);
		}
		public double dot(Vector v) {
			return this.x*v.x+this.y*v.y+this.z*v.z;
		}
		public Vector mult(double c) {
			return new Vector(this.x*c,this.y*c,this.z*c);
		}
		public Vector add(Vector v) {
			return new Vector(this.x+v.x,this.y+v.y,this.z+v.z);
		}
		public Vector neg(){
			return new Vector(-this.x,-this.y,-this.z);
		}
		public double mag() {
			return Math.sqrt(this.dot(this));
		}
		public double angleBetween(Vector v) {
			double phi = (this.cross(v).z < 0)?-2*Math.PI: 0;
			return Math.abs(Math.atan2(this.cross(v).mag(), this.dot(v))+phi);
		}
		public String toString() {
			return this.x+" "+this.y+" "+this.z;
		}
	}
	private static class FS {
		BufferedReader br;
		StringTokenizer st;
		public FS(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}
		String next(){
			while(st==null||!st.hasMoreElements()){
				try{st = new StringTokenizer(br.readLine());}
				catch(IOException e){e.printStackTrace();}
			}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
	}
}