#include <bits/stdc++.h>
using namespace std;
int getDist(int fx, int fy, int tx, int ty) {
  return abs(fx - tx) + abs(fy - ty);
}
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 x = a[i], y = b[i];
    int ans = 0, dist = 1e9 + 1;
    for (int j = 0; j < n; ++j) {
      if (getDist(x, y, c[j], d[j]) < dist) {
        dist = getDist(x, y, c[j], d[j]);
        ans = j;
      }
    }
    cout << ans + 1 << endl;
  }
  return 0;
}
