#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int> > people(n, vector<int>(2)),
      checkpoints(m, vector<int>(2));
  for (int i = 0; i < n; i++) {
    cin >> people[i][0] >> people[i][1];
  }
  for (int i = 0; i < m; i++) {
    cin >> checkpoints[i][0] >> checkpoints[i][1];
  }
  for (int i = 0; i < n; i++) {
    vector<int> dist(m);
    for (int j = 0; j < m; j++) {
      dist[j] = abs(people[i][0] - checkpoints[j][0]) +
                abs(people[i][1] - checkpoints[j][1]);
    }
    sort(dist.begin(), dist.end());
    cout << dist[0] << endl;
  }
  return 0;
}
