#include <bits/stdc++.h>
using namespace std;
int a[100], b[100], c[100], d[100];
int main() {
  int m, n, i, j, e, f;
  cin >> m >> n;
  for (i = 0; i < m; ++i) {
    cin >> a[i] >> b[i];
  }
  for (i = 0; i < n; ++i) {
    cin >> c[i] >> d[i];
  }
  for (i = 0; i < m; ++i) {
    int ans = 100;
    for (j = 0; j < n; ++j) {
      e = fabs(a[i] - c[j]) + fabs(b[i] - d[j]);
      if (ans > e) ans = e;
    }
    cout << ans << endl;
  }
  return 0;
}
