#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int M = 5000005;
pair<int, int> a[N], b[N], mn[N], q[N];
int X[N], Y[N], t[N], n, k;
int rt[N], ls[M], rs[M], S[M], nd;
vector<int> vec[N];
void change(int k, int v) {
  for (; k <= *Y; k += k & (-k)) t[k] = max(t[k], v);
}
int ask(int k) {
  int ans = -(1 << 30);
  for (; k; k -= k & (-k)) ans = max(ans, t[k]);
  return ans;
}
void change(int &nk, int k, int l, int r, int p) {
  nk = ++nd;
  S[nk] = S[k] + 1;
  ls[nk] = ls[k];
  rs[nk] = rs[k];
  if (l == r) return;
  int mid = (l + r) / 2;
  if (p <= mid)
    change(ls[nk], ls[k], l, mid, p);
  else
    change(rs[nk], rs[k], mid + 1, r, p);
}
int ask(int k, int l, int r, int x, int y) {
  if (!k) return 0;
  if (l == x && r == y) return S[k];
  int mid = (l + r) / 2;
  if (y <= mid) return ask(ls[k], l, mid, x, y);
  if (x > mid) return ask(rs[k], mid + 1, r, x, y);
  return ask(ls[k], l, mid, x, mid) + ask(rs[k], mid + 1, r, mid + 1, y);
}
bool ask(int lx, int rx, int ly, int ry) {
  lx = lower_bound(X + 1, X + *X + 1, lx) - X;
  ly = lower_bound(Y + 1, Y + *Y + 1, ly) - Y;
  rx = lower_bound(X + 1, X + *X + 1, rx + 1) - X;
  ry = lower_bound(Y + 1, Y + *Y + 1, ry + 1) - Y;
  if (ly == ry) return 0;
  return ask(rt[lx - 1], 1, *Y, ly, ry - 1) !=
         ask(rt[rx - 1], 1, *Y, ly, ry - 1);
}
void findclosest() {
  *Y = 0;
  for (int i = (int)(1); i <= (int)(n); i++)
    a[i] = pair<int, int>(-a[i].second, a[i].first);
  for (int i = (int)(1); i <= (int)(k); i++)
    b[i] = pair<int, int>(-b[i].second, b[i].first);
  for (int i = (int)(1); i <= (int)(n); i++) Y[++*Y] = a[i].second;
  for (int i = (int)(1); i <= (int)(k); i++) Y[++*Y] = b[i].second;
  sort(Y + 1, Y + *Y + 1);
  *Y = unique(Y + 1, Y + *Y + 1) - Y - 1;
  for (int i = (int)(1); i <= (int)(*Y); i++) t[i] = -(1 << 30);
  for (int i = (int)(1); i <= (int)(n); i++)
    q[i] = pair<int, int>(a[i].first, i);
  for (int i = (int)(1); i <= (int)(k); i++)
    q[i + n] = pair<int, int>(b[i].first, -i);
  sort(q + 1, q + n + k + 1);
  for (int i = (int)(1); i <= (int)(n + k); i++) {
    int id = q[i].second;
    if (id > 0) {
      int p = lower_bound(Y + 1, Y + *Y + 1, a[id].second) - Y;
      mn[id].first = min(mn[id].first, a[id].first + a[id].second - ask(p));
    } else {
      int p = lower_bound(Y + 1, Y + *Y + 1, b[-id].second) - Y;
      change(p, b[-id].first + b[-id].second);
    }
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = (int)(1); i <= (int)(n); i++)
    scanf("%d%d", &a[i].first, &a[i].second);
  for (int i = (int)(1); i <= (int)(k); i++)
    scanf("%d%d", &b[i].first, &b[i].second);
  for (int i = (int)(1); i <= (int)(n); i++) mn[i] = pair<int, int>(1 << 29, i);
  for (int T = (int)(0); T <= (int)(3); T++) findclosest();
  for (int i = (int)(1); i <= (int)(n); i++)
    a[i] = pair<int, int>(a[i].first + a[i].second, a[i].first - a[i].second);
  for (int i = (int)(1); i <= (int)(k); i++)
    b[i] = pair<int, int>(b[i].first + b[i].second, b[i].first - b[i].second);
  *X = *Y = 0;
  for (int i = (int)(1); i <= (int)(k); i++) X[++*X] = b[i].first;
  for (int i = (int)(1); i <= (int)(k); i++) Y[++*Y] = b[i].second;
  X[++*X] = Y[++*Y] = -(1 << 30);
  X[++*X] = Y[++*Y] = (1 << 30);
  sort(X + 1, X + *X + 1);
  sort(Y + 1, Y + *Y + 1);
  *X = unique(X + 1, X + *X + 1) - X - 1;
  *Y = unique(Y + 1, Y + *Y + 1) - Y - 1;
  for (int i = (int)(1); i <= (int)(k); i++) {
    b[i].first = lower_bound(X + 1, X + *X + 1, b[i].first) - X;
    b[i].second = lower_bound(Y + 1, Y + *Y + 1, b[i].second) - Y;
    vec[b[i].first].push_back(b[i].second);
  }
  for (int i = (int)(1); i <= (int)(*X); i++) {
    rt[i] = rt[i - 1];
    for (auto j : vec[i]) change(rt[i], rt[i], 1, *Y, j);
  }
  sort(mn + 1, mn + n + 1);
  int l = 0, r = (1 << 29), ans;
  while (l <= r) {
    int mid = (l + r) / 2;
    int lx = -(1 << 29), rx = -lx;
    int ly = lx, ry = rx, ok = 0;
    for (int i = (int)(n); i >= (int)(1); i--) {
      int id = mn[i].second;
      int d = mid - mn[i].first;
      if (d >= 0) {
        ok |= ask(lx - d, rx + d, ly - d, ry + d);
        if (ok) break;
      }
      lx = max(lx, a[id].first - mid);
      ly = max(ly, a[id].second - mid);
      rx = min(rx, a[id].first + mid);
      ry = min(ry, a[id].second + mid);
      if (lx > rx || ly > ry) break;
    }
    ok |= (lx <= rx && ly <= ry);
    if (ok)
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
}
