#include <bits/stdc++.h>
int main() {
  int number_of_students, number_of_checkpoint, i, j, min_distance,
      min_distance_index, temp_distance;
  scanf("%d %d", &number_of_students, &number_of_checkpoint);
  int student_point_x[number_of_students];
  int student_point_y[number_of_students];
  int checkpoint_point_x[number_of_checkpoint];
  int checkpoint_point_y[number_of_checkpoint];
  for (i = 0; i < number_of_students; i++) {
    scanf("%d %d", &student_point_x[i], &student_point_y[i]);
  }
  for (i = 0; i < number_of_checkpoint; i++) {
    scanf("%d %d", &student_point_x[i], &student_point_y[i]);
  }
  for (i = 0; i < number_of_students; i++) {
    min_distance = INT_MAX;
    for (j = 0; j < number_of_checkpoint; j++) {
      temp_distance = abs(student_point_x[i] - checkpoint_point_x[j]) +
                      abs(student_point_y[i] - checkpoint_point_y[j]);
      if (min_distance > temp_distance) {
        min_distance = temp_distance;
        min_distance_index = j;
      }
    }
    printf("%d\n", min_distance_index + 1);
  }
  return 0;
}
