#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  pair<int, int> x[50];
  pair<int, int> y[50];
  int mini[50];
  cin >> n >> m;
  for (int i = (0); i < (n); i++) {
    cin >> x[i].first >> x[i].second;
    mini[i] = 1000000000;
  }
  for (int i = (0); i < (m); i++) {
    cin >> y[i].first >> y[i].second;
  }
  for (int i = (0); i < (m); i++) {
    mini[i] = min(
        mini[i], abs(x[i].first - y[i].first) + abs(x[i].second - y[i].second));
    if (i >= m - 1) {
      cout << mini[i] << endl;
    }
  }
}
