#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int N, M;
  std::cin >> N >> M;
  struct Vector2 {
    int x;
    int y;
  };
  std::vector<Vector2> student_poses(N);
  std::vector<Vector2> checkpoint_poses(M);
  for (int times = 0; times < N; times++) {
    int student_pos_x;
    int student_pos_y;
    std::cin >> student_pos_x >> student_pos_y;
    Vector2 student_pos;
    student_pos.x = student_pos_x;
    student_pos.y = student_pos_y;
    student_poses[times] = student_pos;
  }
  for (int times = 0; times < M; times++) {
    int checkpoint_pos_x;
    int checkpoint_pos_y;
    std::cin >> checkpoint_pos_x >> checkpoint_pos_y;
    Vector2 checkpoint_pos;
    checkpoint_pos.x = checkpoint_pos_x;
    checkpoint_pos.y = checkpoint_pos_y;
    checkpoint_poses[times] = checkpoint_pos;
  }
  for (int human_index = 0; human_index < N; human_index++) {
    auto student_pos = student_poses[human_index];
    int near_check_point_index = INT16_MAX;
    int near_check_point_distance = INT16_MAX;
    for (int checkpoint_index = M - 1; checkpoint_index >= 0;
         checkpoint_index--) {
      auto checkpoint_pos = checkpoint_poses[checkpoint_index];
      auto distance = std::abs(checkpoint_pos.x - student_pos.x) +
                      std::abs(checkpoint_pos.y - student_pos.y);
      if (distance <= near_check_point_distance) {
        near_check_point_distance = distance;
        near_check_point_index = checkpoint_index + 1;
      }
    }
    std::cout << near_check_point_index << '\n';
  }
  return 0;
}
