#include <bits/stdc++.h>
int min_distance(int x, int y, int *a, int *b, int num_check) {
  int min = 999;
  int distance;
  int i;
  int point = 0;
  for (i = 0; i < num_check; i++) {
    distance = abs(x - a[i]) + abs(y - b[i]);
    if (min > distance) {
      min = distance;
      point = i + 1;
    }
  }
  return point;
}
int main(void) {
  int num_stu, num_check;
  int *x, *y;
  int *a, *b;
  int *check;
  scanf("%d", &num_stu);
  scanf("%d", &num_check);
  x = (int *)malloc(num_stu * sizeof(int));
  y = (int *)malloc(num_stu * sizeof(int));
  check = (int *)malloc(num_stu * sizeof(int));
  a = (int *)malloc(num_check * sizeof(int));
  b = (int *)malloc(num_check * sizeof(int));
  int i;
  for (i = 0; i < num_stu; i++) {
    scanf("%d %d", &x[i], &y[i]);
  }
  for (i = 0; i < num_check; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  for (i = 0; i < num_stu; i++) {
    check[i] = min_distance(x[i], y[i], a, b, num_check);
    printf("%d\n", check[i]);
  }
  return 0;
}
