#include <bits/stdc++.h>
int main(void) {
  int n, m;
  int i, j;
  struct {
    int x, y;
  } man[50] = {0}, chk[50] = {0};
  int dist[50][50], min[50];
  int minpt[50];
  scanf("%d %d", &n, &m);
  fprintf(stderr, "n=%d, m=%d\n", n, m);
  for (i = 0; i < n; ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    fprintf(stderr, "man[%d].x=%d, man[%d].y=%d\n", i, a, i, b);
    man[i].x = a;
    man[i].y = b;
    min[i] = 2000000000;
  }
  for (j = 0; j < m; ++j) {
    int a, b;
    scanf("%d %d", &a, &b);
    fprintf(stderr, "chk[%d].x=%d, chk[%d].y=%d\n", j, a, j, b);
    chk[j].x = a;
    chk[j].y = b;
  }
  for (i = 0; i < n; ++i) {
    for (j = 0; j < m; ++j) {
      int x1 = man[i].x, x2 = chk[j].x;
      int y1 = man[i].y, y2 = chk[j].y;
      int d = (x1 < x2)               ? (x2 - x1)
              : (x1 - x2) + (y1 < y2) ? (y2 - y1)
                                      : (y1 - y2);
      dist[i][j] = d;
      if (d < min[i]) {
        fprintf(stderr, "j=%d, d=%d, min[%d]=%d\n", j, d, i, min[i]);
        min[i] = d;
        minpt[i] = j + 1;
      }
    }
  }
  for (i = 0; i < n; ++i) {
    printf("%d\n", minpt[i]);
  }
  return 0;
}
