#include <bits/stdc++.h>

using namespace std;

#define double long double

#define REP(i, n) for(int i=0;i<(int)n;++i)
#define FOR(i, c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

const double EPS = 1e-9;
const double INF = 1e12;
typedef complex<double> P;
namespace std {
    bool operator<(const P &a, const P &b) {
        return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
    }
}

double cross(const P &a, const P &b) {
    return imag(conj(a) * b);
}

double dot(const P &a, const P &b) {
    return real(conj(a) * b);
}

struct L : public vector<P> {
    L(const P &a, const P &b) {
        push_back(a);
        push_back(b);
    }
};

typedef vector<P> G;

struct C {
    P p;
    double r;

    C(const P &p, double r) : p(p), r(r) {}
};

int ccw(P a, P b, P c) {
    b -= a;
    c -= a;
    if (cross(b, c) > 0) return +1;       // counter clockwise
    if (cross(b, c) < 0) return -1;       // clockwise
    if (dot(b, c) < 0) return +2;       // c--a--b on line
    if (norm(b) < norm(c)) return -2;       // a--b--c on line
    return 0;
}

P crosspoint(const L &l, const L &m) {
    double A = cross(l[1] - l[0], m[1] - m[0]);
    double B = cross(l[1] - l[0], l[1] - m[0]);
    if (abs(A) < EPS && abs(B) < EPS) return m[0]; // same line
    if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
    return m[0] + B / A * (m[1] - m[0]);
}

// !CAUTION! number は有理数以上
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]

G convex_cut(const G &g, const L &l) {
    G Q;
    for (int i = 0; i < g.size(); ++i) {
        P A = curr(g, i), B = next(g, i);
        if (ccw(l[0], l[1], A) != -1) Q.push_back(A);
        if (ccw(l[0], l[1], A) * ccw(l[0], l[1], B) < 0)
            Q.push_back(crosspoint(L(A, B), l));
    }
    return Q;
}

G create_rect(double w, double h) {
    return {P(0, 0), P(w, 0), P(w, h), P(0, h)};
}

G shift(G g, P p) {
    for (auto &&i: g) {
        i = i + p;
    }
    return g;
}

/**
 * func: (double) -> boolean
 */
template<class F>
double f_binary_search(double l, double r, F func, int iter = 128) {
    bool l_value = func(l);
    if (l_value == func(r)) return r;
    for (int i = 0; i < iter; i++) {
        double m = (l + r) / 2;
        if (func(m) != l_value) {
            r = m;
        } else {
            l = m;
        }
    }
    return l;
}

void output(double v) {
    printf("%.10Lf\n", tan(v));
    exit(0);
}

double area(const G &g) {
    double A = 0;
    for (int i = 0; i < g.size(); ++i)
        A += cross(curr(g, i), next(g, i));
    return A / 2;
}

double calc(G &g, double theta, bool right) {
    L l = L(P(0, 0), P(cos(theta), sin(theta)));
    if (right) swap(l[0], l[1]);
    return area(convex_cut(g, l));
}

double norm(double x) {
    if (x < 0) {
        x += acos(-1);
    }
    return x;
}

typedef P point;
typedef double number;
typedef G polygon;

enum {
    OUT, ON, IN
};

int convex_contains(const polygon &P, const point &p) {
    const int n = P.size();
    point g = (P[0] + P[n / 3] + P[2 * n / 3]) / (double) 3.0; // inner-point
    int a = 0, b = n;
    while (a + 1 < b) { // invariant: c is in fan g-P[a]-P[b]
        int c = (a + b) / 2;
        if (cross(P[a] - g, P[c] - g) > 0) { // angle < 180 deg
            if (cross(P[a] - g, p - g) > 0 && cross(P[c] - g, p - g) < 0) b = c;
            else a = c;
        } else {
            if (cross(P[a] - g, p - g) < 0 && cross(P[c] - g, p - g) > 0) a = c;
            else b = c;
        }
    }
    b %= n;
    if (cross(P[a] - p, P[b] - p) < 0) return 0;
    if (cross(P[a] - p, P[b] - p) > 0) return 2;
    return 1;
}

double EQ(double a, double b) {
    return abs(a - b) < 1e-9;
}

double LE(double a, double b) {
    return a < b - 1e-9;
}

double GE(double a, double b) {
    return a > b + 1e-9;
}

bool intersect_1pt(const point &a, const point &b,
                   const point &c, const point &d, point &r) {
    number D = cross(b - a, d - c);
    if (EQ(D, 0)) return false;
    number t = cross(c - a, d - c) / D;
    number s = -cross(a - c, b - a) / D;
    r = a + t * (b - a);
    return GE(t, 0) && LE(t, 1) && GE(s, 0) && LE(s, 1);
}

polygon convex_intersect(const polygon &P, const polygon &Q) {
    const int n = P.size(), m = Q.size();
    int a = 0, b = 0, aa = 0, ba = 0;
    enum {
        Pin, Qin, Unknown
    } in = Unknown;
    polygon R;
    do {
        int a1 = (a + n - 1) % n, b1 = (b + m - 1) % m;
        number C = cross(P[a] - P[a1], Q[b] - Q[b1]);
        number A = cross(P[a1] - Q[b], P[a] - Q[b]);
        number B = cross(Q[b1] - P[a], Q[b] - P[a]);
        point r;
        if (intersect_1pt(P[a1], P[a], Q[b1], Q[b], r)) {
            if (in == Unknown) aa = ba = 0;
            R.push_back(r);
            in = B > 0 ? Pin : A > 0 ? Qin : in;
        }
        if (C == 0 && B == 0 && A == 0) {
            if (in == Pin) {
                b = (b + 1) % m;
                ++ba;
            }
            else {
                a = (a + 1) % m;
                ++aa;
            }
        } else if (C >= 0) {
            if (A > 0) {
                if (in == Pin) R.push_back(P[a]);
                a = (a + 1) % n;
                ++aa;
            }
            else {
                if (in == Qin) R.push_back(Q[b]);
                b = (b + 1) % m;
                ++ba;
            }
        } else {
            if (B > 0) {
                if (in == Qin) R.push_back(Q[b]);
                b = (b + 1) % m;
                ++ba;
            }
            else {
                if (in == Pin) R.push_back(P[a]);
                a = (a + 1) % n;
                ++aa;
            }
        }
    } while ((aa < n || ba < m) && aa < 2 * n && ba < 2 * m);
    if (in == Unknown) {
        if (convex_contains(Q, P[0])) return P;
        if (convex_contains(P, Q[0])) return Q;
    }
    return R;
}


int main() {
    double W, H, w, h, x, y;
    cin >> W >> H >> w >> h >> x >> y;
    auto org = shift(create_rect(W, H), -P(W / 2, H / 2));
    auto small = shift(create_rect(w, h), -P(w / 2, h / 2) + P(x, y));
    small = convex_intersect(org, small);

    auto real_calc = [&](double theta, bool right) {
        return calc(org, theta, right) - calc(small, theta, right);
    };


    auto f = [&](double x) {
        return real_calc(x, false) - real_calc(x, true) >= 0.0;
    };

    auto eval = [&](double x) {
        return abs(real_calc(x, false) - real_calc(x, true));
    };

    //cout << eval(atan(0.75)) << "|" << atan(0.75) << endl;
    auto func = [&](double l, double r) {
        double v = f_binary_search(l, r, f);
        //cout << l << " - " << v << " - " << r << "|" << f(v) << endl;
        if (eval(v) < 1e-7) {
            output(v);
        }
    };
    //cout << area(org) << " " << area(small) << endl;

    vector<double> interests;
    interests.push_back(0);
    interests.push_back(acos(-1));
    for (auto &i : org) {
        interests.push_back(norm(atan2(i.imag(), i.real())));
    }
    for (auto &i : small) {
        interests.push_back(norm(atan2(i.imag(), i.real())));
    }
    sort(interests.begin(), interests.end());
    for (int i = 0; i + 1 < interests.size(); i++) {
        func(interests[i], interests[i + 1]);
    }
    assert(0);


}


Measured memory_bytes: 3668