#include <bits/stdc++.h>
template <class Ta, class Tb>
void cxk(Ta& a, Tb b) {
  a = a < b ? b : a;
}
template <class Ta, class Tb>
void cnk(Ta& a, Tb b) {
  a = a > b ? b : a;
}
long long gi() {
  long long x = 0;
  char ch = getchar();
  bool f = 1;
  while (!isdigit(ch)) f ^= ch == '-', ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f ? x : -x;
}
int n, m, px[100010], py[100010], ux[200010], uy[200010];
int sx[100010], sy[100010];
struct bb {
  int x, y, i;
} s[200010];
int st[100010], st2[100010], dst[100010];
int t[200010], N;
void update(int x, int d) {
  while (x <= N) cnk(t[x], d), x += x & -x;
}
int query(int x) {
  int r = 2e9;
  while (x) cnk(r, t[x]), x -= x & -x;
  return r;
}
void Uniform(int* P, int* P2, int* U, int n = ::n, int m = ::m, int N = ::N) {
  memcpy(U + 1, P + 1, n << 2);
  memcpy(U + n + 1, P2 + 1, m << 2);
  std::sort(U + 1, U + N + 1);
  for (int i = 1; i <= n; ++i)
    P[i] = std::lower_bound(U + 1, U + N + 1, P[i]) - U;
  for (int i = 1; i <= m; ++i)
    P2[i] = std::lower_bound(U + 1, U + N + 1, P2[i]) - U;
}
int rt[100010], ls[10000010], rs[10000010], sum[10000010], cnt;
void update(int& x, int l, int r, int p) {
  ++cnt, ls[cnt] = ls[x], rs[cnt] = rs[x], sum[cnt] = sum[x];
  x = cnt;
  ++sum[x];
  if (l == r) return;
  if (p <= ((l + r) >> 1))
    update(ls[x], l, ((l + r) >> 1), p);
  else
    update(rs[x], ((l + r) >> 1) + 1, r, p);
}
int query(int x, int l, int r, int L, int R) {
  if (!sum[x] || (L <= l && r <= R)) return sum[x];
  if (L <= ((l + r) >> 1))
    if (((l + r) >> 1) < R)
      return query(ls[x], l, ((l + r) >> 1), L, R) +
             query(rs[x], ((l + r) >> 1) + 1, r, L, R);
    else
      return query(ls[x], l, ((l + r) >> 1), L, R);
  else
    return query(rs[x], ((l + r) >> 1) + 1, r, L, R);
}
int main() {
  n = gi(), m = gi();
  for (int i = 1; i <= n; ++i)
    px[i] = gi(), py[i] = gi(), st[i] = i, dst[i] = 1e9;
  for (int i = 1; i <= m; ++i) sx[i] = gi(), sy[i] = gi(), st2[i] = i;
  for (int sfm = 0; sfm < 4; ++sfm) {
    N = n + m;
    Uniform(px, sx, ux), Uniform(py, sy, uy);
    for (int i = 1; i <= n; ++i) s[i] = {px[i], py[i], i};
    for (int i = 1; i <= m; ++i) s[i + n] = {sx[i], sy[i], -i};
    std::sort(s + 1, s + N + 1,
              [&](bb a, bb b) { return a.x == b.x ? a.i < b.i : a.x < b.x; });
    memset(t, 63, sizeof t);
    for (int i = 1; i <= N; ++i)
      if (s[i].i > 0)
        cnk(dst[s[i].i], query(s[i].y) + uy[s[i].y] + ux[s[i].x]);
      else
        update(s[i].y, -uy[s[i].y] - ux[s[i].x]);
    for (int i = 1; i <= n; ++i)
      px[i] = ux[px[i]], py[i] = uy[py[i]], std::swap(px[i], py[i]),
      py[i] = -py[i];
    for (int i = 1; i <= m; ++i)
      sx[i] = ux[sx[i]], sy[i] = uy[sy[i]], std::swap(sx[i], sy[i]),
      sy[i] = -sy[i];
  }
  std::sort(st + 1, st + n + 1, [&](int a, int b) { return dst[a] > dst[b]; });
  int l = 0, r = dst[st[1]], mid;
  for (int i = 1, x, y; i <= m; ++i)
    x = sx[i], y = sy[i], sx[i] = x + y, sy[i] = x - y;
  Uniform(sy, 0, uy, m, 0, m);
  for (int i = 1; i <= m; ++i) s[i] = {sx[i], sy[i]};
  std::sort(s + 1, s + m + 1, [&](bb a, bb b) { return a.x < b.x; });
  for (int i = 1; i <= m; ++i) rt[i] = rt[i - 1], update(rt[i], 1, m, s[i].y);
  while (l < r) {
    mid = l + r >> 1;
    bool flg = 0;
    int xl = -1e9, xr = 1e9, yl = -1e9, yr = 1e9;
    for (int _ = 1, i; _ <= n; ++_) {
      i = st[_];
      cxk(xl, px[i] + py[i] - mid);
      cnk(xr, px[i] + py[i] + mid);
      cxk(yl, px[i] - py[i] - mid);
      cnk(yr, px[i] - py[i] + mid);
      if (xl > xr || yl > yr) break;
      if (xl == xr && yl == yr && ((xl ^ yr) & 1)) break;
      if (_ == n) {
        flg = 1;
        break;
      }
      int l =
          std::lower_bound(s + 1, s + m + 1, bb{xl - (mid - dst[st[_ + 1]]), 0},
                           [&](bb a, bb b) { return a.x < b.x; }) -
          s;
      int r =
          std::upper_bound(s + 1, s + m + 1, bb{xr + (mid - dst[st[_ + 1]]), 0},
                           [&](bb a, bb b) { return a.x < b.x; }) -
          s - 1;
      if (l > r) continue;
      int L =
          std::lower_bound(uy + 1, uy + m + 1, yl - (mid - dst[st[_ + 1]])) -
          uy;
      int R = std::upper_bound(uy + 1, uy + m + 1, yr + mid - dst[st[_ + 1]]) -
              uy - 1;
      if (L > R) continue;
      if (query(rt[r], 1, m, L, R) - query(rt[l - 1], 1, m, L, R)) {
        flg = 1;
        break;
      }
    }
    if (flg)
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", r);
  return 0;
}
