#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const long long Inf = 1e10;
const int P = 1e9 + 7;
const int N = 10005;
inline long long IN() {
  long long x = 0;
  int ch = 0, f = 0;
  for (ch = getchar(); ch != -1 && (ch < 48 || ch > 57); ch = getchar())
    f = (ch == '-');
  for (; ch >= 48 && ch <= 57; ch = getchar())
    x = (x << 1) + (x << 3) + ch - '0';
  return f ? (-x) : x;
}
template <typename T>
inline int chkmin(T &a, const T &b) {
  if (b < a) return a = b, 1;
  return 0;
}
template <typename T>
inline int chkmax(T &a, const T &b) {
  if (b > a) return a = b, 1;
  return 0;
}
void renew(int &x, const int &y) {
  x += y;
  if (x >= P) x -= P;
  if (x < 0) x += P;
}
int Pow(int x, int y, int p) {
  int a = 1;
  for (; y; y >>= 1, x = (long long)x * x % p)
    if (y & 1) a = (long long)a * x % p;
  return a;
}
int n, m, fr;
int perm[N];
struct po {
  double x, y, nrm;
  int c;
  po() {}
  po(double x, double y, int z) : x(x), y(y), c(z) { nrm = x * x + y * y; }
  po operator-(const po &a) const { return po(x - a.x, y - a.y, c); }
} A[N], B[N], C[N << 1];
struct eve {
  double x;
  int pr;
} S[N << 1];
int tot;
void Ins(double l, double r, int w) {
  if (w == 1) {
    S[++tot] = (eve){l, -3};
    S[++tot] = (eve){r, 3};
  } else {
    S[++tot] = (eve){l, -1};
    S[++tot] = (eve){r, 1};
  }
}
void Insert(double l, double r, int w) {
  if (l < 0) l += 2 * M_PI;
  if (l >= 2 * M_PI) l -= 2 * M_PI;
  if (r < 0) r += 2 * M_PI;
  if (r >= 2 * M_PI) r -= 2 * M_PI;
  if (l < +r) {
    Ins(l, r, w);
  } else {
    Ins(l, 2 * M_PI, w);
    Ins(0, r, w);
  }
}
int cmp(const eve &a, const eve &b) {
  if (a.x != b.x) return a.x < b.x;
  return a.pr < b.pr;
}
int cnt, flag;
int check(double rad) {
  tot = 0;
  for (int j = (int)(1); j <= (int)(cnt); j++) {
    double d = sqrt(C[j].nrm);
    if (C[j].nrm > 4 * rad * rad) continue;
    if (C[j].c && C[j].nrm >= 4 * rad * rad) continue;
    double a = atan2(C[j].y, C[j].x);
    double b = acos(d / (2 * rad));
    Insert(a - b, a + b, C[j].c);
  }
  if (!flag) {
    S[++tot] = (eve){0, -1};
  }
  sort(S + 1, S + tot + 1, cmp);
  int totr = 0, totb = 0;
  for (int i = (int)(1); i <= (int)(tot); i++) {
    if (totr && !totb) return 1;
    if (S[i].x == 2 * M_PI) break;
    if (S[i].pr == -1) totr++;
    if (S[i].pr == 1) totr--;
    if (S[i].pr == -3) totb++;
    if (S[i].pr == 3) totb--;
    if (totr && !totb) return 1;
  }
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (int)(1); i <= (int)(n); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    A[i] = po(x, y, 0);
  }
  for (int i = (int)(1); i <= (int)(m); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    B[i] = po(x, y, 1);
  }
  for (int i = (int)(1); i <= (int)(n); i++) perm[i] = i;
  random_shuffle(perm + 1, perm + n + 1);
  double ans = 0;
  for (int i = (int)(1); i <= (int)(n); i++) {
    int fr = perm[i];
    flag = 0;
    cnt = 0;
    for (int j = (int)(1); j <= (int)(n); j++)
      if (j ^ fr) C[++cnt] = A[j] - A[fr];
    for (int j = (int)(1); j <= (int)(m); j++) C[++cnt] = B[j] - A[fr];
    if (!check(ans)) continue;
    if (check(1e15)) {
      puts("-1");
      return 0;
    }
    double r = ans + 1;
    for (; check(r); r *= 2)
      ;
    double l = ans;
    for (int i = (int)(1); i <= (int)(60); i++) {
      double md = (l + r) / 2;
      if (check(md)) {
        l = md;
      } else {
        r = md;
      }
    }
    ans = l;
  }
  for (int i = (int)(1); i <= (int)(m); i++) perm[i] = i;
  random_shuffle(perm + 1, perm + m + 1);
  for (int i = (int)(1); i <= (int)(m); i++) {
    int fr = perm[i];
    flag = 1;
    cnt = 0;
    for (int j = (int)(1); j <= (int)(n); j++) C[++cnt] = A[j] - B[fr];
    for (int j = (int)(1); j <= (int)(m); j++)
      if (j ^ fr) C[++cnt] = B[j] - B[fr];
    if (!check(ans)) continue;
    if (check(1e15)) {
      puts("-1");
      return 0;
    }
    double r = ans + 1;
    for (; check(r); r *= 2)
      ;
    double l = ans;
    for (int i = (int)(1); i <= (int)(60); i++) {
      double md = (l + r) / 2;
      if (check(md)) {
        l = md;
      } else {
        r = md;
      }
    }
    ans = l;
  }
  printf("%.20lf\n", ans);
  return 0;
}
