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>
import java.util.*;
import java.io.*;
public class Solution implements Runnable {
    FastScanner sc;
    PrintWriter pw;
    
    final class FastScanner {
        BufferedReader br;
        StringTokenizer st;
 
        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
 
        public long nlo() {
            return Long.parseLong(next());
        }
 
        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }
 
        public int ni() {
            return Integer.parseInt(next());
        }
 
        public String nli() {
            String line = "";
            if (st.hasMoreTokens()) line = st.nextToken();
            else try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            while (st.hasMoreTokens()) line += " " + st.nextToken();
            return line;
        }
 
        public double nd() {
            return Double.parseDouble(next());
        }
    }
    public static void main(String[] args) throws Exception
    {
        new Thread(null,new Solution(),"codeforces",1<<28).start();
    }
    public void run()
    {
        sc=new FastScanner();
        pw=new PrintWriter(System.out);
        try{
        solve();}
        catch(Exception e)
        {
            pw.println(e);
        }
        pw.flush();
        pw.close();
    }
    public long gcd(long a,long b)
    {
        return b==0L?a:gcd(b,a%b);
    }
    public long ppow(long a,long b,long mod)
    {
        if(b==0L)
        return 1L;
        long tmp=1;
        while(b>1L)
        {
            if((b&1L)==1)
            tmp*=a;
            a*=a;
            a%=mod;
            tmp%=mod;
            b>>=1;
        }
        return (tmp*a)%mod;
    }
    public long pow(long a,long b)
    {
        if(b==0L)
        return 1L;
        long tmp=1;
        while(b>1L)
        {
            if((b&1L)==1)
            tmp*=a;
            a*=a;
            b>>=1;
        }
        return (tmp*a);
    }
    public  int gcd(int x,int y)
    {
        return y==0?x:gcd(y,x%y);
    }
   
    //////////////////////////////////
    /////////////  LOGIC  ///////////
    ////////////////////////////////
    
    public void solve() throws Exception{
        double a,b,c,x1,y1,x2,y2;
        a=sc.nd();b=sc.nd();c=sc.nd();x1=sc.nd();y1=sc.nd();x2=sc.nd();y2=sc.nd();
        double ans=Math.abs(x1-x2)+Math.abs(y1-y2);
        double[][] arr=points(x1,y1,a,b,c);
        double[][] brr=points(x2,y2,a,b,c);
        double[][] drr=new double[2][2];
        drr[0][0]=x1;drr[0][1]=y1;drr[1][0]=x2;drr[1][1]=y2;
        ans=Math.min(ans,f(arr,brr,drr[0],drr[1]));
        ans=Math.min(ans,f(brr,arr,drr[1],drr[0]));
        pw.println(ans);
   }
   public double[][] points(double x,double y,double a,double b,double c){
       double[][] ret=new double[2][2];
       ret[0][0]=x;
       ret[0][1]=b==0?Integer.MAX_VALUE:((-1d*c-a*x)/b);
       ret[1][1]=y;
       ret[1][0]=a==0?Integer.MAX_VALUE:((-1d*c-b*y)/a);
       return ret;
   }
   public double dist(double[] a,double[] b,boolean s){
       double max=Integer.MAX_VALUE;
       if(a[0]==max||a[1]==max||b[0]==max||b[1]==max)
       return max;
       if(s)
       return Math.sqrt(Math.pow(a[0]-b[0],2)+Math.pow(a[1]-b[1],2));
       return Math.abs(a[0]-b[0])+Math.abs(a[1]-b[1]);
   }
   public double f(double[][] arr,double[][] brr,double[] d1,double[] d2){
       double ans=Double.MAX_VALUE;
       ans=Math.min(ans,dist(d1,arr[0],false)+dist(arr[0],brr[0],true)+dist(brr[0],d2,false));
       ans=Math.min(ans,dist(d1,arr[0],false)+dist(arr[0],brr[1],true)+dist(brr[1],d2,false));
       ans=Math.min(ans,dist(d1,arr[0],false)+dist(arr[0],d2,false));
       
       ans=Math.min(ans,dist(d1,arr[1],false)+dist(arr[1],brr[0],true)+dist(brr[0],d2,false));
       ans=Math.min(ans,dist(d1,arr[1],false)+dist(arr[1],brr[1],true)+dist(brr[1],d2,false));
       ans=Math.min(ans,dist(d1,arr[1],false)+dist(arr[1],d2,false));
       return ans;
   }
}