#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(const T& t) {
  cout << t << "\n";
}
template <class T, class... Ts>
void print(const T& t, const Ts&... ts) {
  cout << t;
  if (sizeof...(ts)) cout << " ";
  print(ts...);
}
template <template <class...> class Ctn, class T>
std::ostream& operator<<(std::ostream& os, const Ctn<T>& v) {
  auto itr = v.begin();
  while (itr != v.end()) {
    if (itr != v.begin()) cout << " ";
    cout << *(itr++);
  }
  return os;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, long long>> st(n), ch(m);
  for (int i = 0; i < (n); i++) {
    int a, b;
    cin >> a >> b;
    st[i] = {a, b};
  }
  for (int i = 0; i < (m); i++) {
    int a, b;
    cin >> a >> b;
    ch[i] = {a, b};
  }
  for (int i = 0; i < (n); i++) {
    long long d =
        (max(st[i].first - ch[0].first, -st[i].first - ch[0].first) +
         max(st[i].second - ch[0].second, -st[i].second - ch[0].second));
    for (int j = (1); j < (m); j++) {
      (d > ((max(st[i].first - ch[j].first, -st[i].first - ch[j].first) +
             max(st[i].second - ch[j].second, -st[i].second - ch[j].second)))
       ? d = ((max(st[i].first - ch[j].first, -st[i].first - ch[j].first) +
               max(st[i].second - ch[j].second, -st[i].second - ch[j].second))),
       1 : 0);
    }
    print(d);
  }
}
