#include <bits/stdc++.h>
using namespace std;
const int fin = 0;
const long double eps = 1e-12;
long double AB, AC, BC;
long double t1, t2;
inline long double Abs(const long double &a) { return a > 0 ? a : -a; }
inline long double Sqrt(const long double &C) {
  long double x = C, t;
  while (t = (x + C / x) * 0.5, Abs(t - x) > 1e-12) x = t;
  return x;
}
struct pt {
  long double x, y;
  pt() {}
  pt(const long double &x, const long double &y) : x(x), y(y) {}
  friend istream &operator>>(istream &I, pt &a) { return I >> a.x >> a.y, I; }
  pt operator+(const pt &a) { return pt(x + a.x, y + a.y); }
} A, B, C;
long double d(const pt &a, const pt &b) {
  return Sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
bool chk(pt P, long double r1, pt Q, long double r2, pt S, long double r3) {
  long double x0 = Q.x - P.x, y0 = Q.y - P.y,
              T = (r1 * r1 - r2 * r2 + x0 * x0 + y0 * y0) * 0.5;
  long double x, y;
  if (Abs(y0) < eps) {
    x = T / x0, y = Sqrt(r1 * r1 - x * x);
    if (d(P + pt(x, y), S) <= r3) return 1;
    y = -y;
    if (d(P + pt(x, y), S) <= r3) return 1;
  }
  long double A = x0 * x0 + y0 * y0, B = -2 * T * x0,
              C = T * T - r1 * r1 * y0 * y0,
              D = max(B * B - 4 * A * C, (long double)0);
  x = (-B - Sqrt(D)) * 0.5 / A, y = (T - x * x0) / y0;
  if (d(P + pt(x, y), S) <= r3) return 1;
  x = (-B + Sqrt(D)) * 0.5 / A, y = (T - x * x0) / y0;
  if (d(P + pt(x, y), S) <= r3) return 1;
  return 0;
}
bool check(long double m) {
  long double r1 = m, r2 = max(AB + t1 - m, (long double)0),
              r3 = max(AC + t2 - m, (long double)0);
  if (r1 + r2 < AB) return 0;
  if (r2 + r3 < BC) return 0;
  if (r1 + r3 < AC) return 0;
  if (Abs(r1 - r2) >= AB) return 1;
  if (Abs(r2 - r3) >= BC) return 1;
  if (Abs(r1 - r3) >= AC) return 1;
  if (chk(A, r1, B, r2, C, r3)) return 1;
  if (chk(A, r1, C, r3, B, r2)) return 1;
  if (chk(B, r2, C, r3, A, r1)) return 1;
  return 0;
}
int main() {
  if (fin) {
    freopen("t.in", "r", stdin);
    freopen("t.out", "w", stdout);
  }
  long double l, r, m;
  cin >> t1 >> t2 >> A >> C >> B;
  AB = d(A, B), AC = d(A, C), BC = d(B, C);
  l = 0, r = min(AB + BC + t1, AC + t2);
  if (AC + t2 + eps >= AB + BC) return printf("%.12lf", (double)r), 0;
  while (l + 1e-6 < r) {
    m = (l + r) * 0.5;
    if (check(m))
      l = m;
    else
      r = m;
  }
  printf("%.12lf", (double)l);
  return 0;
}
