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>
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ii = pair<int, int>;
using lu = unsigned long long;
using l = long long;
using vs = vector<string>;
using vii = vector<ii>;
using vl = vector<l>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using ll = pair<l, l>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vvd = vector<vd>;
using mll = unordered_map<l, l>;
using sl = unordered_set<l>;
const l INF = numeric_limits<l>::max();
const double EPS = 1e-10;
const double PI = 3.14159265358979323846;
const l e0 = 1, e3 = 1000, e5 = 100000, e6 = 10 * e5, e7 = 10 * e6,
        e8 = 10 * e7, e9 = 10 * e8;
const char lf = '\n';
void solve(istream& in, ostream& out);
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(15);
  solve(cin, cout);
}
const l MOD = e9 + 7;
struct point {
  double x, y;
  point() {}
  point(double _x, double _y) : x(_x), y(_y) {}
  double operator*(const point& o) { return x * o.x + y * o.y; }
  point operator*(const double m) { return point(x * m, y * m); }
  double operator^(const point& o) { return x * o.y - y * o.x; }
  point operator-(const point& o) { return point(x - o.x, y - o.y); }
  point operator+(const point& o) { return point(x + o.x, y + o.y); }
  double operator>>(const point& o) {
    point d = (*this - o);
    return d * d;
  }
  double distance(const point& o) { return sqrt(*this >> o); }
  bool equal(double a, double b) const {
    if (abs(a - b) < EPS) return true;
    if (abs(a) < EPS || abs(b) < EPS) return false;
    return (abs((a - b) / a) < EPS) && (abs((a - b) / b) < EPS);
  }
  bool operator<(const point& o) const {
    if (o.x != x) return x < o.x;
    if (not equal(o.x, x)) return x < o.x;
    return y < o.y;
  }
};
l segment_intersection(point a, point b, point c, point d, point& o1,
                       point& o2) {
  point x = c - a, y = d - a, z = b - a;
  double t = (x ^ z) + (z ^ y);
  if (abs(t) < EPS) {
    if (abs(x ^ y) < EPS) {
      vector<point> v = {a, b, c, d};
      sort(begin(v), end(v));
      o1 = v[1];
      o2 = v[2];
      return 2;
    } else {
      return 0;
    }
  }
  t = (x ^ y) / t;
  if (t < 0 or t > 1) return 0;
  o1 = o2 = a + z * t;
  return 1;
}
ostream& operator<<(ostream& s, const point& p) {
  s << "(" << p.x << ", " << p.y << ")";
  return s;
}
using vp = vector<point>;
vp intersect(double a, double b, double c, point p) {
  vp z;
  if (b != 0) {
    z.emplace_back(p.x, (-c - a * p.x) / b);
  }
  if (a != 0) {
    z.emplace_back((-c - b * p.y) / a, p.y);
  }
  return z;
}
void solve(istream& in, ostream& out) {
  double a, b, c;
  in >> a >> b >> c;
  point q, w;
  in >> q.x >> q.y >> w.x >> w.y;
  double z = abs(q.x - w.x) + abs(q.y - w.y);
  auto iq = intersect(a, b, c, q), iw = intersect(a, b, c, w);
  for (auto x : iq)
    for (auto y : iw) {
      z = min(z, q.distance(x) + x.distance(y) + y.distance(w));
    }
  out << setprecision(12) << z << lf;
}
