#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long>> a(n);
  vector<pair<long long, long long>> c(m);
  vector<long long> ans(n);
  for (int i = 0; i < (int)n; i++) cin >> a[i].first >> a[i].second;
  for (int i = 0; i < (int)m; i++) cin >> c[i].first >> c[i].second;
  for (int i = 0; i < (int)n; i++) ans[i] = 0;
  for (int i = 0; i < (int)n; i++) {
    for (int j = 0; j < (int)m - 1; j++) {
      if (abs(a[i].first - c[j].first) + abs(a[i].second - c[j].second) >
          (abs(a[i].first - c[j + 1].first) +
           abs(a[i].second - c[j + 1].second))) {
        ans[i] = abs(a[i].first - c[j + 1].first) +
                 abs(a[i].second - c[j + 1].second);
      }
    }
  }
  for (int i = 0; i < (int)n; i++) cout << ans[i] + 1 << endl;
}
