#include <bits/stdc++.h>
int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int N, M;
  std::cin >> N >> M;
  std::vector<int> a(N), b(N), c(M), d(M);
  for (int i = 0; i < N; i++) std::cin >> a.at(i) >> b.at(i);
  for (int i = 0; i < M; i++) {
    std::cin >> c.at(i) >> d.at(i);
  }
  int nearest = 0;
  int check_point = 0;
  for (int i = 0; i < N; i++) {
    nearest = 100000001;
    for (int j = 0; j < M; j++) {
      const int tmp = abs(a.at(i) - c.at(j)) + abs(b.at(i) - d.at(j));
      if (tmp < nearest) {
        nearest = tmp;
        check_point = j + 1;
      }
    }
    std::cout << check_point << std::endl;
  }
  return 0;
}
