#include <bits/stdc++.h>
int main(void) {
  int N, M;
  scanf("%d %d", &N, &M);
  int *a = (int *)malloc(N * sizeof(int));
  int *b = (int *)malloc(N * sizeof(int));
  int *c = (int *)malloc(M * sizeof(int));
  int *d = (int *)malloc(M * sizeof(int));
  int i, j;
  for (i = 0; i < N; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  for (i = 0; i < M; i++) {
    scanf("%d %d", &c[i], &d[i]);
  }
  for (i = 0; i < N; i++) {
    int min = INT_MAX;
    int index = 0;
    for (j = 0; j < M; j++) {
      if (c[j] != INT_MAX) {
        if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
          min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
          index = j;
        }
      }
    }
    printf("%d\n", index + 1);
    c[index] = INT_MAX;
  }
  free(a);
  free(b);
  free(c);
  free(d);
  return 0;
}
