#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-12;
struct dot {
  double x, y;
  dot() {}
  dot(double x1, double y1) {
    x = x1;
    y = y1;
  }
  dot operator+(const dot &o) { return dot(x + o.x, y + o.y); }
  dot operator-(const dot &o) { return dot(x - o.x, y - o.y); }
  void make(double d) {
    double k = sqrt(x * x + y * y);
    k = d / k;
    x *= k;
    y *= k;
  }
} p[5], a, b;
double r[5], a1, a2;
int t1, t2;
void Init() {
  scanf("%d%d", &t1, &t2);
  scanf("%lf%lf", &p[1].x, &p[1].y);
  scanf("%lf%lf", &p[3].x, &p[3].y);
  scanf("%lf%lf", &p[2].x, &p[2].y);
}
double dis(dot a, dot b) {
  return ((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y));
}
double mysqrt(double x) {
  if (x <= eps) return 0;
  return sqrt(x);
}
void cut(int i, int j) {
  double dd, d, x, y;
  dot f1, f2;
  dd = dis(p[i], p[j]);
  d = sqrt(dd);
  x = ((r[i]) * (r[i])) - ((r[j]) * (r[j])) + dd;
  x /= (2 * d);
  y = mysqrt(((r[i]) * (r[i])) - ((x) * (x)));
  f1 = p[j] - p[i];
  f1.make(x);
  f2 = f1;
  swap(f2.x, f2.y);
  f2.x = -f2.x;
  f2.make(y);
  a = p[i] + f1 + f2;
  b = p[i] + f1 - f2;
}
bool in(dot a, int k) {
  double d = dis(a, p[k]);
  return d <= ((r[k]) * (r[k])) + eps;
}
int get(int i, int j) {
  if (r[i] > r[j]) swap(i, j);
  double d = sqrt(dis(p[i], p[j]));
  if (d > r[i] + r[j] + eps) return 0;
  if (d < r[j] - r[i] - eps) return 1;
  return 2;
}
bool okay(double d) {
  r[1] = d;
  r[2] = a1 + t1 - d;
  r[3] = a2 + t2 - d;
  for (int i = 1; i <= 2; ++i)
    for (int j = i + 1; j <= 3; ++j) {
      int p = get(i, j), k = 6 - i - j;
      if (p == 0) return 0;
      if (p == 1) {
        int t = i, l;
        if (r[t] > r[j]) t = j;
        l = get(t, k);
        if (l == 0) return 0;
        return 1;
      }
      cut(i, j);
      if (in(a, k) || in(b, k)) return 1;
    }
  return 0;
}
void Work() {
  double tmp;
  a1 = sqrt(dis(p[1], p[2]));
  a2 = sqrt(dis(p[1], p[3]));
  tmp = a1 + sqrt(dis(p[2], p[3]));
  if (tmp <= a2 + t2 + eps) {
    tmp += t1;
    tmp = ((tmp) < (a2 + t2) ? (tmp) : (a2 + t2));
    printf("%.6lf\n", tmp);
    return;
  }
  double l = 0, r = a2 + t2, mid;
  for (int i = 1; i <= 200; ++i) {
    mid = (l + r) * 0.5;
    if (okay(mid))
      l = mid;
    else
      r = mid;
  }
  printf("%.6lf\n", l);
}
int main() {
  Init();
  Work();
  return 0;
}
