#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-10;
struct Vector {
  long double x, y;
  Vector(long double _x = 0, long double _y = 0) : x(_x), y(_y) {}
  Vector operator+(const Vector& rhs) const {
    return Vector(x + rhs.x, y + rhs.y);
  }
  Vector operator-(const Vector& rhs) const {
    return Vector(x - rhs.x, y - rhs.y);
  }
  Vector Rotate(long double theta) {
    long double nx = x * cos(theta) - y * sin(theta);
    long double ny = x * sin(theta) + y * cos(theta);
    return Vector(nx, ny);
  }
  long double len() { return sqrt(x * x + y * y); }
  long double len2() { return x * x + y * y; }
  void Read() { cin >> x >> y; }
};
struct Rad {
  double r;
  Vector O;
} lis[3];
long double Opt_val(long double u) {
  if (u < -1) return -1;
  if (u > 1) return 1;
  return u;
}
long double sqr(long double u) { return u * u; }
vector<Vector> inter_lis;
void getInter(Rad a, Rad b) {
  if (a.r + b.r + eps < (a.O - b.O).len()) return;
  if (a.r < b.r) swap(a, b);
  if (a.r > (a.O - b.O).len() + b.r) {
    inter_lis.push_back(a.O);
    inter_lis.push_back(b.O);
    return;
  }
  Vector vec = a.O - b.O;
  long double theta =
      acos(Opt_val((vec.len2() + sqr(b.r) - sqr(a.r)) / (2 * vec.len() * b.r)));
  long double cur_len = vec.len();
  vec.x /= cur_len, vec.y /= cur_len;
  vec.x *= b.r, vec.y *= b.r;
  inter_lis.push_back(b.O + vec.Rotate(theta));
  inter_lis.push_back(b.O + vec.Rotate(-theta));
}
bool check() {
  inter_lis.clear();
  for (int i = 0; i < 3; i++) {
    for (int j = i + 1; j < 3; j++) {
      getInter(lis[i], lis[j]);
    }
  }
  for (int i = 0; i < (int)inter_lis.size(); i++) {
    bool ok = true;
    for (int j = 0; j < 3; j++) {
      long double cur_len = (inter_lis[i] - lis[j].O).len();
      if (cur_len > lis[j].r + eps) ok = false;
    }
    if (ok) return true;
  }
  return false;
}
int main() {
  long double t1, t2;
  cin >> t1 >> t2;
  for (int i = 0; i < 3; i++) lis[i].O.Read();
  t1 += (lis[0].O - lis[2].O).len();
  t1 += (lis[1].O - lis[2].O).len();
  t2 += (lis[1].O - lis[0].O).len();
  if (t2 + eps >= (lis[0].O - lis[2].O).len() + (lis[1].O - lis[2].O).len()) {
    printf("%.10f\n", (double)min(t1, t2));
    return 0;
  }
  t1 -= (lis[1].O - lis[2].O).len();
  long double L = 0, R = min(t1, t2);
  while (R - L > eps) {
    long double mid = (L + R) / 2;
    lis[0].r = mid;
    lis[1].r = t2 - mid;
    lis[2].r = t1 - mid;
    if (check())
      L = mid;
    else
      R = mid;
  }
  printf("%.10f\n", (double)L);
  return 0;
}
