#include <bits/stdc++.h>
int dist(int x0, int y0, int x1, int y1) {
  return std::abs(x0 - x1) + std::abs(y0 - y1);
}
int main(void) {
  int N, M;
  std::vector<int> a, b, c, d;
  std::cin >> N;
  std::cin >> M;
  a.resize(N);
  b.resize(N);
  c.resize(N);
  d.resize(N);
  for (int i = 0; i < N; i++) {
    std::cin >> a[i];
    std::cin >> b[i];
  }
  for (int i = 0; i < M; i++) {
    std::cin >> c[i];
    std::cin >> d[i];
  }
  for (int i = 0; i < N; i++) {
    int min_id = -1;
    int min = 0x7fffffff;
    for (int j = 0; j < M; j++) {
      int dt = dist(a[i], b[i], c[j], d[j]);
      if (dt < min) {
        min_id = j;
        min = dt;
      }
    }
    std::cout << (min_id + 1) << std::endl;
  }
}
