The determinant of a matrix 2 × 2 is defined as follows:

A matrix is called degenerate if its determinant is equal to zero. 

The norm ||*A*|| of a matrix *A* is defined as a maximum of absolute values of its elements.

You are given a matrix <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/e78540a0de68f85833f82714a7141114b781276e.png" style="max-width: 100.0%;max-height: 100.0%;"/>. Consider any degenerate matrix *B* such that norm ||*A* - *B*|| is minimum possible. Determine ||*A* - *B*||.
The first line contains two integers *a* and *b* (|*a*|, |*b*| ≤ 10<sup class="upper-index">9</sup>), the elements of the first row of matrix *A*. 

The second line contains two integers *c* and *d* (|*c*|, |*d*| ≤ 10<sup class="upper-index">9</sup>) the elements of the second row of matrix *A*.
import math

def sign(x):
    return math.copysign(1, x)

a, b = [float(x) for x in input().split()]
c, d = [float(x) for x in input().split()]


best = float('inf')

for mask in range(16):
    pa = 1 - 2 * ((mask     ) & 1)
    pb = 1 - 2 * ((mask >> 1) & 1)
    pc = 1 - 2 * ((mask >> 2) & 1)
    pd = 1 - 2 * ((mask >> 3) & 1)

    y = lambda x: (pb * b - pa * (a - x)) / pb
    z = lambda x: (pc * c - pa * (a - x)) / pc
    w1 = lambda x: (pd * d - pa * (a - x)) / pd
    w2 = lambda x: z(x) * y(x) / x

    delta_w = lambda x: w1(x) - w2(x)

    l = 1e-9
    at_l = delta_w(l)
    r = 1.0
    while at_l * delta_w(r) >= 0:
        r *= 2.0
    at_r = delta_w(r)

    mid = (l + r) * 0.5
    while abs(delta_w(mid)) > 1e-10:
        if delta_w(mid) * at_l >= 0:
            l = mid
        else:
            r = mid
        mid = (l + r) * 0.5

    ans = abs(pa * (a - mid))
    if ans < best:
        best = ans

print(best)
