#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, const U &b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, const U &b) {
  if (a < b) a = b;
}
char gchar() {
  static char tbuf1[1000], *tmp_st = tbuf1, *tmp_ed = tbuf1;
  if (tmp_st == tmp_ed) {
    int len = fread(tbuf1, 1, 1000, stdin);
    if (len == 0) return -1;
    tmp_ed = tbuf1 + len;
    tmp_st = tbuf1;
  }
  return *(tmp_st++);
}
inline bool gn(int &first) {
  char c, sg = 0;
  while (c = gchar(), (c > '9' || c < '0') && c != '-' && ~c)
    ;
  if (c == -1) return 0;
  for ((c == '-' ? sg = 1, c = gchar() : 0), first = 0; c >= '0' && c <= '9';
       c = gchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
  return 1;
}
inline void print(int first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
int id[100001], LL[400000], RR[400000];
int first[100001], second[100001], xmn[400000], xmx[400000], ymn[400000],
    ymx[400000];
inline void select(int L, int mid, int R, int *val) {
  R--;
  while (L + 1 <= R) {
    if (L + 1 == R) {
      if (val[id[L]] > val[id[R]]) swap(id[L], id[R]);
      return;
    }
    int S = L + 1, X = S + rand() * rand() % (R - L);
    swap(id[L], id[X]);
    if (val[id[L]] > val[id[R]]) swap(id[L], id[R]);
    if (val[id[L]] > val[id[S]]) swap(id[L], id[S]);
    if (val[id[S]] > val[id[R]]) swap(id[S], id[R]);
    int i = L, j = R, p = val[id[S]];
    while (1) {
      while (i <= R && val[id[i]] <= p) i++;
      while (j >= L && val[id[j]] >= p) j--;
      if (i > j) break;
      swap(id[i], id[j]);
    }
    if (mid <= j)
      R = j;
    else if (mid >= i)
      L = i;
    else
      break;
  }
}
inline void build(int u, int L, int R, int dp = 0) {
  LL[u] = L, RR[u] = R;
  if (L + 1 == R) {
    xmn[u] = xmx[u] = first[id[L]];
    ymn[u] = ymx[u] = second[id[L]];
    return;
  }
  int ls = u << 1, rs = ls | 1, mid = L + R >> 1;
  if (dp)
    select(L, mid, R, first);
  else
    select(L, mid, R, second);
  dp ^= 1;
  build(ls, L, mid, dp);
  build(rs, mid, R, dp);
  xmn[u] = min(xmn[ls], xmn[rs]), xmx[u] = max(xmx[ls], xmx[rs]);
  ymn[u] = min(ymn[ls], ymn[rs]), ymx[u] = max(ymx[ls], ymx[rs]);
}
int ax, ay, bx, by;
inline bool calc(int u) {
  if (xmn[u] > bx || xmx[u] < ax || ymn[u] > by || ymx[u] < ay) return false;
  if (ax <= xmn[u] && xmx[u] <= bx && ay <= ymn[u] && ymx[u] <= by) return true;
  if (LL[u] + 1 == RR[u]) return false;
  int ls = u << 1;
  if (calc(ls)) return true;
  return calc(ls | 1);
}
pair<pair<int, int>, int> p[100001];
int n, m;
inline bool can(int T) {
  ax = ay = -200000000, bx = by = 200000000;
  for (int i = 0; i < n; i++) {
    if (ax <= bx && ay <= by) {
      if (m && p[i].second <= T) {
        int d = T - p[i].second;
        ax -= d, bx += d, ay -= d, by += d;
        if (calc(1)) return true;
        ax += d, bx -= d, ay += d, by -= d;
      }
    } else
      return false;
    int first = p[i].first.first, second = p[i].first.second;
    smax(ax, first - T), smin(bx, first + T);
    smax(ay, second - T), smin(by, second + T);
  }
  return ax <= bx && ay <= by;
}
int main() {
  srand(time(0));
  gn(n), gn(m);
  if (n == 1) return puts("0");
  for (int i = 0, first, second; i < n; i++) {
    gn(first), gn(second);
    p[i] = pair<pair<int, int>, int>(
        pair<int, int>(first - second, first + second), 0);
  }
  for (int i = 0, first, second; i < m; i++) {
    gn(first), gn(second);
    ::first[i] = first - second;
    ::second[i] = first + second;
    id[i] = i;
  }
  if (m) build(1, 0, m);
  for (int i = 0, first, second; i < n; i++) {
    first = p[i].first.first, second = p[i].first.second;
    int st = -1, ed = 200000000;
    while (st + 1 < ed) {
      int md = st + ed >> 1;
      ax = first - md, bx = first + md, ay = second - md, by = second + md;
      if (m && calc(1))
        ed = md;
      else
        st = md;
    }
    p[i].second = ed;
  }
  sort(p, p + n, [](pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
    return a.second > b.second;
  });
  int st = -1, ed = 200000000;
  while (st + 1 < ed) {
    int md = st + ed >> 1;
    if (can(md))
      ed = md;
    else
      st = md;
  }
  print(ed);
}
