In this problem we consider a very simplified model of Barcelona city.

Barcelona can be represented as a plane with streets of kind x = c and y = c for every integer c (that is, the rectangular grid). However, there is a detail which makes Barcelona different from Manhattan. There is an avenue called Avinguda Diagonal which can be represented as a the set of points (x, y) for which ax + by + c = 0.

One can walk along streets, including the avenue. You are given two integer points A and B somewhere in Barcelona. Find the minimal possible distance one needs to travel to get to B from A.

Input

The first line contains three integers a, b and c (-10^9≤ a, b, c≤ 10^9, at least one of a and b is not zero) representing the Diagonal Avenue.

The next line contains four integers x_1, y_1, x_2 and y_2 (-10^9≤ x_1, y_1, x_2, y_2≤ 10^9) denoting the points A = (x_1, y_1) and B = (x_2, y_2).

Output

Find the minimum possible travel distance between A and B. Your answer is considered correct if its absolute or relative error does not exceed 10^{-6}.

Formally, let your answer be a, and the jury's answer be b. Your answer is accepted if and only if \frac{|a - b|}{max{(1, |b|)}} ≤ 10^{-6}.

Examples

Input


1 1 -3
0 3 3 0


Output


4.2426406871


Input


3 1 -9
0 3 3 -1


Output


6.1622776602

Note

The first example is shown on the left picture while the second example us shown on the right picture below. The avenue is shown with blue, the origin is shown with the black dot.

<image>
//package ;
import java.io.*;
import java.util.*;

public class Problem_1079D
{
	static double solve(double x1,double y1,double x2,double y2)
	{
		Point[]p=new Point[4];
		double[]d=new double[4];
		Point p1=new Point(x1,((a*x1)+c)/-b);p[0]=p1;
		double d1=Math.abs(y1-p1.y);d[0]=d1;
		Point p2=new Point((b*y1+c)/-a, y1);p[1]=p2;
		double d2=Math.abs(x1-p2.x);d[1]=d2;
		
		Point p3=new Point(x2,((a*x2)+c)/-b);p[2]=p3;
		double d3=Math.abs(y2-p3.y);d[2]=d3;
		Point p4=new Point((b*y2+c)/-a, y2);p[3]=p4;
		double d4=Math.abs(x2-p4.x);d[3]=d4;
		if(a==0)
		{
			p[1]=null;
			p[3]=null;
			d[1]=Double.MAX_VALUE;
			d[3]=Double.MAX_VALUE;
		}
		if(b==0)
		{
			p[0]=null;
			p[2]=null;
			d[0]=Double.MAX_VALUE;
			d[2]=Double.MAX_VALUE;
		}
//		System.out.println(Arrays.toString(p));
//		System.out.println(Arrays.toString(d));
		double ans=Double.MAX_VALUE;
		for(int i=0;i<2;i++)
			for(int j=2;j<4;j++)
			{
//				if(p[i]==null || p[j]==null || !valid(p[i])||!valid(p[j]))
//					continue;
				if(p[i]==null || p[j]==null)continue;
				double tmp=solve(p[i],p[j])+d[i]+d[j];
//				System.out.println(i+" "+j+" "+tmp);
				ans=Math.min(ans, tmp);
			}
		return ans;
	}
	static boolean valid(Point p)
	{
		return p.x==(long)p.x && p.y==(long)p.y;
	}
	static double solve(Point p1,Point p2)
	{
		double x=p1.x-p2.x;
		double y=p1.y-p2.y;
		x*=x;y*=y;
		double tmp=x+y;
//		System.out.print(tmp+" ");
		return Math.sqrt(tmp);
	}
	static long a,b,c;
	public static void main(String[] args) throws IOException 
	{
		Scanner sc = new Scanner();
		PrintWriter pw = new PrintWriter(System.out);
		a=sc.nextLong();b=sc.nextLong();c=sc.nextLong();
		double x1=sc.nextLong(),y1=sc.nextLong(),
				x2=sc.nextLong(),y2=sc.nextLong();
		System.out.println(Math.min(solve(x1,y1,x2,y2),Math.abs(x1-x2)+Math.abs(y1-y2)));
//		System.out.println(Math.sqrt(10));
		pw.close();    
	}
	static class Point
	{
		double x,y;
		public Point(double x,double y) {
			// TODO Auto-generated constructor stub
			this.x=x;this.y=y;
		}
		@Override
		public String toString() {
			// TODO Auto-generated method stub
			return "( "+x+" ,"+y+" )";
		}
	}
	static class Scanner {
		BufferedReader br;
		StringTokenizer st;
		
		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		String next() throws IOException {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}
		
		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
		
		long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		
		double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
		
		String nextLine() throws IOException {
			return br.readLine();
		}
		boolean hasnext() throws IOException{
			return br.ready();
		}
		
	}
}
