#include <bits/stdc++.h>
using namespace std;
int n, K;
pair<int, int> p1[100010], p2[100010];
vector<int> lsx, lsy;
vector<int> m1[200010], m2[200010];
int mndis[100010];
class sgt {
 public:
  int mn[800010];
  void init() { memset(mn, 0x3f, sizeof(mn)); }
  void modify(int p, int l, int r, int pos, int v) {
    mn[p] = min(mn[p], v);
    if (l == r) return;
    int mid = (l + r) >> 1;
    if (pos <= mid)
      modify((p << 1), l, mid, pos, v);
    else
      modify(((p << 1) | 1), mid + 1, r, pos, v);
  }
  int query(int p, int l, int r, int ql, int qr) {
    if (ql <= l && r <= qr) return mn[p];
    int mid = (l + r) >> 1, ret = 0x3f3f3f3f;
    if (ql <= mid) ret = query((p << 1), l, mid, ql, qr);
    if (qr > mid) ret = min(ret, query(((p << 1) | 1), mid + 1, r, ql, qr));
    return ret;
  }
} T1, T2;
int id[100010];
class node {
 public:
  int sum, ch[2];
};
class tree {
 public:
  int nodecnt;
  int rt[100010];
  node t[10000000];
  void modify(int &p, int l, int r, int pos) {
    if (!p) p = ++nodecnt;
    t[p].sum++;
    if (l == r) return;
    int mid = (l + r) >> 1;
    if (pos <= mid)
      modify(t[p].ch[0], l, mid, pos);
    else
      modify(t[p].ch[1], mid + 1, r, pos);
  }
  int query(int p, int l, int r, int ql, int qr) {
    if (!p) return 0;
    if (ql <= l && r <= qr) return t[p].sum;
    int mid = (l + r) >> 1, ret = 0;
    if (ql <= mid) ret = query(t[p].ch[0], l, mid, ql, qr);
    if (qr > mid) ret += query(t[p].ch[1], mid + 1, r, ql, qr);
    return ret;
  }
  inline int lowbit(int x) { return x & (-x); }
  void modify(int x, int y) {
    x = lower_bound(lsx.begin(), lsx.end(), x) - lsx.begin() + 1;
    y = lower_bound(lsy.begin(), lsy.end(), y) - lsy.begin();
    for (; x <= lsx.size(); x += lowbit(x)) modify(rt[x], 0, lsy.size() - 1, y);
  }
  int query(int p, int ly, int ry) {
    int ret = 0;
    for (; p; p -= lowbit(p)) ret += query(rt[p], 0, lsy.size() - 1, ly, ry);
    return ret;
  }
  int query(int lx, int rx, int ly, int ry) {
    lx = lower_bound(lsx.begin(), lsx.end(), lx) - lsx.begin() + 1;
    rx = upper_bound(lsx.begin(), lsx.end(), rx) - lsx.begin();
    ly = lower_bound(lsy.begin(), lsy.end(), ly) - lsy.begin();
    ry = upper_bound(lsy.begin(), lsy.end(), ry) - lsy.begin() - 1;
    if (lx > rx || ly > ry) return 0;
    return query(rx, ly, ry) - query(lx - 1, ly, ry);
  }
} T;
inline bool check(int l) {
  int l1 = -1e9, r1 = 1e9, l2 = -1e9, r2 = 1e9;
  for (int i = 1; i <= n; i++) {
    int c = id[i];
    if (mndis[c] <= l) {
      int d = l - mndis[c];
      if (T.query(l1 - d, r1 + d, l2 - d, r2 + d)) return 1;
    }
    l1 = max(l1, p1[c].first + p1[c].second - l);
    r1 = min(r1, p1[c].first + p1[c].second + l);
    l2 = max(l2, p1[c].first - p1[c].second - l);
    r2 = min(r2, p1[c].first - p1[c].second + l);
    if (l1 > r1 || l2 > r2) return 0;
  }
  return l1 <= r1 && l2 <= r2;
}
inline int cmp(int x, int y) { return mndis[x] > mndis[y]; }
int main() {
  memset(mndis, 0x3f, sizeof(mndis));
  scanf("%d%d", &n, &K);
  for (int i = 1; i <= n; i++)
    scanf("%d%d", &p1[i].first, &p1[i].second), id[i] = i;
  for (int i = 1; i <= K; i++) scanf("%d%d", &p2[i].first, &p2[i].second);
  for (int i = 1; i <= n; i++)
    lsx.push_back(p1[i].first), lsy.push_back(p1[i].second);
  for (int i = 1; i <= K; i++)
    lsx.push_back(p2[i].first), lsy.push_back(p2[i].second);
  sort(lsx.begin(), lsx.end());
  sort(lsy.begin(), lsy.end());
  lsx.erase(unique(lsx.begin(), lsx.end()), lsx.end());
  lsy.erase(unique(lsy.begin(), lsy.end()), lsy.end());
  for (int i = 1; i <= n; i++)
    m1[lower_bound(lsx.begin(), lsx.end(), p1[i].first) - lsx.begin()]
        .push_back(i);
  for (int i = 1; i <= K; i++)
    m2[lower_bound(lsx.begin(), lsx.end(), p2[i].first) - lsx.begin()]
        .push_back(i);
  T1.init();
  T2.init();
  for (int i = 0; i < lsx.size(); i++) {
    for (auto &x : m2[i]) {
      int p = lower_bound(lsy.begin(), lsy.end(), p2[x].second) - lsy.begin();
      T1.modify(1, 0, lsy.size() - 1, p, -p2[x].first - p2[x].second);
      T2.modify(1, 0, lsy.size() - 1, p, p2[x].second - p2[x].first);
    }
    for (auto &x : m1[i]) {
      int p = lower_bound(lsy.begin(), lsy.end(), p1[x].second) - lsy.begin();
      mndis[x] = min(
          mndis[x],
          min(p1[x].first + p1[x].second + T1.query(1, 0, lsy.size() - 1, 0, p),
              p1[x].first - p1[x].second +
                  T2.query(1, 0, lsy.size() - 1, p, lsy.size() - 1)));
    }
  }
  T1.init();
  T2.init();
  for (int i = lsx.size() - 1; i >= 0; i--) {
    for (auto &x : m2[i]) {
      int p = lower_bound(lsy.begin(), lsy.end(), p2[x].second) - lsy.begin();
      T1.modify(1, 0, lsy.size() - 1, p, p2[x].first - p2[x].second);
      T2.modify(1, 0, lsy.size() - 1, p, p2[x].second + p2[x].first);
    }
    for (auto &x : m1[i]) {
      int p = lower_bound(lsy.begin(), lsy.end(), p1[x].second) - lsy.begin();
      mndis[x] = min(
          mndis[x], min(-p1[x].first + p1[x].second +
                            T1.query(1, 0, lsy.size() - 1, 0, p),
                        -p1[x].first - p1[x].second +
                            T2.query(1, 0, lsy.size() - 1, p, lsy.size() - 1)));
    }
  }
  lsx.clear();
  lsy.clear();
  for (int i = 1; i <= K; i++)
    lsx.push_back(p2[i].first + p2[i].second),
        lsy.push_back(p2[i].first - p2[i].second);
  sort(lsx.begin(), lsx.end());
  sort(lsy.begin(), lsy.end());
  lsx.erase(unique(lsx.begin(), lsx.end()), lsx.end());
  lsy.erase(unique(lsy.begin(), lsy.end()), lsy.end());
  for (int i = 1; i <= K; i++)
    T.modify(p2[i].first + p2[i].second, p2[i].first - p2[i].second);
  sort(id + 1, id + n + 1, cmp);
  int L = 0, R = 200000000, ret = -1;
  while (L <= R) {
    int mid = (L + R) >> 1;
    if (check(mid))
      ret = mid, R = mid - 1;
    else
      L = mid + 1;
  }
  printf("%d\n", ret);
  return 0;
}
