#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[100], b[100], c[100], d[100], count = 0, sm;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int j = 0; j < m; j++) cin >> c[j] >> d[j];
  for (int k = 0; k < n; k++) {
    for (int l = 0; l < m; l++) {
      count = abs(a[k] - c[l]) + abs(b[k] - d[l]);
      if (k == 0 && l == 0) sm = count;
      if (sm > count) sm = l + 1;
      count = 0;
    }
    cout << sm << endl;
  }
  return 0;
}
