#include <bits/stdc++.h>
int main() {
  int N, M;
  std::cin >> N >> M;
  std::vector<int> a(N);
  std::vector<int> b(N);
  for (int i = 0; i < N; ++i) {
    std::cin >> a[i] >> b[i];
  }
  std::vector<int> c(M);
  std::vector<int> d(M);
  for (int i = 0; i < M; ++i) {
    std::cin >> c[i] >> d[i];
  }
  for (int i = 0; i < N; ++i) {
    int min = 0x1ffffff;
    int check = 0;
    for (int j = 0; j < M; ++j) {
      int distance = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (distance < min) {
        min = distance;
        check = j + 1;
      }
    }
    std::cout << check << std::endl;
  }
  return 0;
}
