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.awt.geom.Line2D;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;

public class A {
	public static class Event implements Comparable<Event>{
		public double time;
		public boolean start;
		public Event(double a, boolean b){
			time = a;
			start = b;
		}
		public int compareTo(Event o){
			if(Math.abs(time-o.time)<1e-11){
				if(start==o.start){
					return 0;
				}
				if(start){
					return 1;
				}
				return -1;
			}
			return Double.compare(time, o.time);
		}
	}
	public static boolean inside(int x1, int y1, int x2, int y2, int x, int y){
		if(x>x1 && x<x2 && y>y1 && y<y2){
			return true;
		}
		return false;
	}
	public static boolean inside(double x1, double y1, double x2, double y2, double x, double y){
		if(x-1e-11>x1 && x+1e-11<x2 && y-1e-11>y1 && y+1e-11<y2){
			return true;
		}
		return false;
	}
	public static void main(String[] args) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int len = Integer.parseInt(in.readLine());
		String[] line = in.readLine().split(" ");
		long x1 = Integer.parseInt(line[0]);
		long y1 = Integer.parseInt(line[1]);
		long x2 = Integer.parseInt(line[2]);
		long y2 = Integer.parseInt(line[3]);
		long max = 200000;
		int len2 = 0;
		boolean ok = true;
		if(x1==x2 || y1==y2){
			ok = false;
		}
		ArrayList<Event> li = new ArrayList<Event>();
		li.add(new Event(0.0,true));
		li.add(new Event((double)max,false));
		for(int i = 0; i<len && ok; i++){
			line = in.readLine().split(" ");
			long sx = Integer.parseInt(line[0]);
			long sy = Integer.parseInt(line[1]);
			long vx = Integer.parseInt(line[2]);
			long vy = Integer.parseInt(line[3]);
			long ex = sx+max*vx;
			long ey = sy+max*vy;
			if(vx==0 && vy==0){
				if(inside(x1,y1,x2,y2,sx,sy)){
//					System.out.println("A");
					continue;
				}
				else{
//					System.out.println("B");
					ok = false;
					break;
				}
			}
			double[] xx = {x1,x1,x2,x2};
			double[] yy = {y2,y1,y1,y2};
			ArrayList<Double> times = new ArrayList<Double>();
//			System.out.println("!");
			for(int j = 0; j<4; j++){
				int k = (j+1)%4;
				if(Line2D.linesIntersect(xx[j], yy[j], xx[k], yy[k], sx, sy, ex, ey)){
					if(xx[j]==xx[k] && vx!=0){
//						System.out.println(j+" A");
						times.add((double)(xx[j]-sx)/(double)vx);
					}
					if(yy[j]==yy[k] && vy!=0){
//						System.out.println(j+" B");
						times.add((double)(yy[j]-sy)/(double)vy);
					}
				}
			}
			Collections.sort(times);
			if(times.size()==0){
				ok = false;
				break;
			}
//			System.out.println(times.size());
			if(times.size()==3){
				if(times.get(1)-times.get(0)<1e-11){
					double a = times.get(1);
					double b = times.get(2);
					times.clear();
					times.add(a);
					times.add(b);
				}
				else{
					double a = times.get(0);
					double b = times.get(1);
					times.clear();
					times.add(a);
					times.add(b);
				}
			}
			if(times.size()==4){
				double a = times.get(1);
				double b = times.get(2);
				times.clear();
				times.add(a);
				times.add(b);
			}
			
			if(times.size()==2){
				double mt = (times.get(0)+times.get(1))/2.0;
				double mx = (double)sx+((double)vx)*mt;
				double my = (double)sy+((double)vy)*mt;
				if(times.get(1)-times.get(0)>1e-11 && inside(x1,y1,x2,y2,mx,my)){
					li.add(new Event(times.get(0),true));
					li.add(new Event(times.get(1),false));
//					System.out.println("A");
				}
				else if(times.get(1)-times.get(0)<1e-11 && inside(x1,y1,x2,y2,sx,sy)){
					li.add(new Event(0.0,true));
					li.add(new Event(times.get(1),false));
//					System.out.println("B");
				}
				else{
					ok = false;
//					System.out.println("C");
					break;
				}
			}
			if(times.size()==1){
				if(inside(x1,y1,x2,y2,sx,sy) && times.get(0)>1e-11){
					li.add(new Event(0.0,true));
					li.add(new Event(times.get(0),false));
				}
				else{
					ok = false;
					break;
				}
			}
		}
		len2 = li.size()/2;
		int count = 0;
		double ans = -1.0;
//		System.out.println(ok);
		Collections.sort(li);
//		System.out.println(ok +" "+li.size());
		if(ok){
			for(int i = 0; i<li.size(); i++){
//				System.out.println(i+" "+li.get(i).start+" "+li.get(i).time);
				if(li.get(i).start){
					count++;
				}
				else{
					count--;
				}
				if(count==len2){
					ans = li.get(i).time;
				}
			}
			if(ans<-0.5){
				ok = false;
			}
		}
		if(ok){
			System.out.printf("%.100f\n",ans);
		}
		else{
			System.out.println(-1);
		}
	}
}