#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n);
  for (int(i) = (0); (i) < (n); (i)++) {
    cin >> a[i] >> b[i];
  }
  vector<int> c(m), d(m);
  for (int(i) = (0); (i) < (m); (i)++) {
    cin >> c[i] >> d[i];
  }
  for (int(i) = (0); (i) < (n); (i)++) {
    int minidx = 0;
    int minx = 500000000;
    for (int(j) = (0); (j) < (m); (j)++) {
      int t = abs(c[i] - a[i]) + abs(d[i] - b[i]);
      if (t < minx) {
        minx = t;
        minidx = i;
      }
    }
    cout << minidx + 1 << endl;
  }
  return 0;
}
