#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);
struct L : array<complex<double>, 2> {
  L(const complex<double> &a, const complex<double> &b) {
    at(0) = a;
    at(1) = b;
  }
  L() {}
};
struct C {
  complex<double> p;
  double r;
  C(const complex<double> &p, const double &r) : p(p), r(r) {}
  C() {}
};
namespace std {
bool operator<(const complex<double> &a, const complex<double> &b) {
  return !(abs((a.real()) - (b.real())) < EPS) ? a.real() < b.real()
                                               : a.imag() + EPS < b.imag();
}
bool operator==(const complex<double> &a, const complex<double> &b) {
  return abs(a - b) < EPS;
}
}  // namespace std
double dot(complex<double> a, complex<double> b) {
  return (conj(a) * b).real();
}
double cross(complex<double> a, complex<double> b) {
  return (conj(a) * b).imag();
}
int ccw(complex<double> a, complex<double> b, complex<double> c) {
  b -= a;
  c -= a;
  if (cross(b, c) > EPS) return +1;
  if (cross(b, c) < -EPS) return -1;
  if (dot(b, c) < -EPS) return +2;
  if (abs(c) - abs(b) > EPS) return -2;
  return 0;
}
complex<double> unit(const complex<double> &p) { return p / abs(p); }
complex<double> rotate(const complex<double> &p, double rad) {
  return p * complex<double>(cos(rad), sin(rad));
}
bool intersectSS(const L &a, const L &b) {
  return (ccw(a[0], a[1], b[0]) * ccw(a[0], a[1], b[1]) <= 0) &&
         (ccw(b[0], b[1], a[0]) * ccw(b[0], b[1], a[1]) <= 0);
}
complex<double> projection(const L &l, const complex<double> &p) {
  double t = dot(p - l[0], l[0] - l[1]) / norm(l[0] - l[1]);
  return l[0] + t * (l[0] - l[1]);
}
double distanceLP(const L &l, const complex<double> &p) {
  return abs(cross(l[1] - l[0], p - l[0])) / abs(l[1] - l[0]);
}
double distanceSP(const L &s, const complex<double> &p) {
  if (dot(s[1] - s[0], p - s[0]) < EPS) return abs(p - s[0]);
  if (dot(s[0] - s[1], p - s[1]) < EPS) return abs(p - s[1]);
  return distanceLP(s, p);
}
bool isParallel(const complex<double> &a, const complex<double> &b) {
  return abs(cross(a, b)) < EPS;
}
bool isParallel(const L &a, const L &b) {
  return isParallel(a[1] - a[0], b[1] - b[0]);
}
complex<double> crosspointLL(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]);
  return m[0] + B / A * (m[1] - m[0]);
}
vector<complex<double> > crosspointCL(const C &c, const L &l) {
  vector<complex<double> > ret;
  complex<double> mid = projection(l, c.p);
  double d = distanceLP(l, c.p);
  if ((abs((d) - (c.r)) < EPS)) {
    ret.push_back(mid);
  } else if (d < c.r) {
    double len = sqrt(c.r * c.r - d * d);
    ret.push_back(mid + len * unit(l[1] - l[0]));
    ret.push_back(mid - len * unit(l[1] - l[0]));
  }
  return ret;
}
vector<L> getTangentLine(const C &c, const complex<double> &p) {
  vector<L> ret;
  complex<double> dir = p - c.p;
  if (c.r < abs(dir) + EPS) {
    complex<double> a = c.p + c.r * unit(dir);
    vector<complex<double> > cp =
        crosspointCL(C(c.p, abs(dir)), L(a, a + dir * complex<double>(0, 1)));
    for (int i = 0; i < (int)cp.size(); i++) {
      ret.push_back(L(p, c.p + c.r * unit(cp[i] - c.p)));
    }
  }
  return ret;
}
struct edge {
  int to, rev;
  int cap;
  double cost;
  edge(int to, int rev, int cap, double cost)
      : to(to), rev(rev), cap(cap), cost(cost) {}
  edge() {}
};
double min_cost_flow(int s, int g, int f, vector<vector<edge> > &adj) {
  int n = adj.size();
  double res = 0;
  while (f > 0) {
    vector<int> prevv(n), preve(n);
    vector<double> mincost(n, INF);
    mincost[s] = 0;
    while (1) {
      bool update = false;
      for (int i = 0; i < n; i++) {
        if (mincost[i] == INF) continue;
        for (int j = 0; j < (int)adj[i].size(); j++) {
          edge &e = adj[i][j];
          if (e.cap > 0 && mincost[i] + e.cost + EPS < mincost[e.to]) {
            mincost[e.to] = mincost[i] + e.cost;
            prevv[e.to] = i;
            preve[e.to] = j;
            update = true;
          }
        }
      }
      if (!update) break;
    }
    if (mincost[g] == INF) {
      return -1;
    }
    int d = f;
    for (int v = g; v != s; v = prevv[v]) {
      d = min(d, adj[prevv[v]][preve[v]].cap);
    }
    f -= d;
    res += d * mincost[g];
    for (int v = g; v != s; v = prevv[v]) {
      edge &e = adj[prevv[v]][preve[v]];
      e.cap -= d;
      adj[v][e.rev].cap += d;
    }
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  vector<C> c(2);
  for (int i = 0; i < 2; i++) {
    double x, y, r;
    cin >> x >> y >> r;
    c[i] = C(complex<double>(x, y), r);
  }
  vector<vector<complex<double> > > pos(2, vector<complex<double> >(n));
  for (int d = 0; d < 2; d++) {
    for (int i = 0; i < n; i++) {
      double x, y;
      cin >> x >> y;
      pos[d][i] = complex<double>(x, y);
    }
  }
  vector<vector<double> > dist(n, vector<double>(n, INF));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      vector<L> tangent;
      vector<L> ret;
      for (int d = 0; d < 2; d++) {
        ret = getTangentLine(c[d], pos[0][i]);
        tangent.insert(tangent.end(), ret.begin(), ret.end());
        ret = getTangentLine(c[d], pos[1][j]);
        tangent.insert(tangent.end(), ret.begin(), ret.end());
      }
      vector<complex<double> > cand;
      cand.push_back((pos[0][i] + pos[1][j]) / 2.0);
      for (int s = 0; s < (int)tangent.size(); s++) {
        for (int t = s + 1; t < (int)tangent.size(); t++) {
          if (!isParallel(tangent[s], tangent[t])) {
            cand.push_back(crosspointLL(tangent[s], tangent[t]));
          }
        }
      }
      for (complex<double> cp : cand) {
        if (distanceSP(L(pos[0][i], cp), c[0].p) + EPS > c[0].r &&
            distanceSP(L(pos[0][i], cp), c[1].p) + EPS > c[1].r &&
            distanceSP(L(pos[1][j], cp), c[0].p) + EPS > c[0].r &&
            distanceSP(L(pos[1][j], cp), c[1].p) + EPS > c[1].r) {
          dist[i][j] =
              min(dist[i][j], abs(pos[0][i] - cp) + abs(pos[1][j] - cp));
        }
      }
    }
  }
  vector<vector<edge> > adj(2 * n + 2);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      adj[i + 2].emplace_back(j + 2 + n, adj[j + 2 + n].size(), 1, dist[i][j]);
      adj[j + 2 + n].emplace_back(i + 2, adj[i + 1].size() - 1, 0, dist[i][j]);
    }
    adj[0].emplace_back(i + 2, adj[i + 2].size(), 1, 0);
    adj[i + 2].emplace_back(0, adj[0].size(), 0, 0);
    adj[i + 2 + n].emplace_back(1, adj[1].size(), 1, 0);
    adj[1].emplace_back(i + 2 + n, adj[i + 2 + n].size() - 1, 0, 0);
  }
  double ans = min_cost_flow(0, 1, n, adj);
  if (ans == -1) {
    cout << "impossible" << endl;
  } else {
    cout << fixed << setprecision(10);
    cout << ans << endl;
  }
  return 0;
}
