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.math.BigDecimal;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static BigDecimal a;
	public static BigDecimal b;
	public static BigDecimal c;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		a = sc.nextBigDecimal();
		b = sc.nextBigDecimal();
		c = sc.nextBigDecimal();
		BigDecimal x1 = sc.nextBigDecimal();
		BigDecimal y1 = sc.nextBigDecimal();
		BigDecimal x2 = sc.nextBigDecimal();
		BigDecimal y2 = sc.nextBigDecimal();
		//a * x + b * y + c == 0
		// check 1 -> up , 0 -> on , -1 -> down
		BigDecimal ans = x1.subtract(x2).abs().add(y1.subtract(y2).abs());
		// 点到直线的距离 + 在直线上的位置 => 计算直线上两点的距离(勾股定理)
		// S 起点
		if(a.compareTo(BigDecimal.ZERO) != 0 && b.compareTo(BigDecimal.ZERO) != 0){
			BigDecimal sx1 = x1 , sy1 = GetLength(x1);
			BigDecimal len_sx1 = sy1.subtract(y1).abs();
			BigDecimal sx2 = GetLength2(y1) , sy2 = y1;
			BigDecimal len_sx2 = sx2.subtract(x1).abs();
			// T 终点
			BigDecimal tx1 = x2 , ty1 = GetLength(x2);
			BigDecimal len_tx1 = ty1.subtract(y2).abs();
			BigDecimal tx2 = GetLength2(y2) , ty2 = y2;
			BigDecimal len_tx2 = tx2.subtract(x2).abs();
			// 3 , -1 -> 3 * x + 1 * -1 + -9 = 0
			BigDecimal dis;
			//sx1 , sy1 -- tx1 , ty1
			dis = getDis(sx1 , sy1 , tx1 , ty1);
			ans = ans.min(len_sx1.add(len_tx1).add(dis));
			//sx1 , sy1 -- tx2 , ty2
			dis = getDis(sx1 , sy1 , tx2 , ty2);
			ans = ans.min(len_sx1.add(len_tx2).add(dis));
			//sx2 , sy2 -- tx1 , ty1
			dis = getDis(sx2 , sy2 , tx1 , ty1);
			ans = ans.min(len_sx2.add(len_tx1).add(dis));
			//sx2 , sy2 -- tx2 , ty2
			dis = getDis(sx2 , sy2 , tx2 , ty2);
			ans = ans.min(len_sx2.add(len_tx2).add(dis));
		}
		Double fans = Double.valueOf(ans.toString());
		System.out.println(String.format("%.6f",fans));
	}
	private static BigDecimal getDis(BigDecimal x1, BigDecimal y1, BigDecimal x2, BigDecimal y2) {
		// sqrt[(x1-x2) ^ 2 + (y1-y2) ^ 2]
		BigDecimal dx = x1.subtract(x2);
		dx = dx.multiply(dx);
		BigDecimal dy = y1.subtract(y2);
		dy = dy.multiply(dy);
		return BigDecimal.valueOf(Math.sqrt(Double.valueOf(dx.add(dy).toString())));
	}
	private static BigDecimal GetLength2(BigDecimal y) {
		// 带入y求x坐标 , a * x + b * y + c = 0
		// x = -1 * (c + b * y) / a
		return c.add(b.multiply(y)).multiply(BigDecimal.valueOf(-1)).divide(a, 15, BigDecimal.ROUND_HALF_UP);
	}
	private static BigDecimal GetLength(BigDecimal x) {
		// 带入x求y坐标 , a * x + b * y + c = 0
		// y = -1 * (c + a * x) / b
		return c.add(a.multiply(x)).multiply(BigDecimal.valueOf(-1)).divide(b ,15, BigDecimal.ROUND_HALF_UP);
	}

}
