#include <bits/stdc++.h>
int manh(int, int, int, int);
int main(void) {
  int N, M;
  int a[50], b[50], c[50], d[50];
  int i, j;
  int pnum, dmin;
  scanf("%d %d\n", &N, &M);
  for (i = 0; i < N; i++) {
    scanf("%d %d\n", &a[i], &b[i]);
  }
  for (j = 0; j < M; j++) {
    scanf("%d %d\n", &c[j], &d[j]);
  }
  for (i = 0; i < N; i++) {
    dmin = 50;
    pnum = 0;
    for (j = 0; j < M; j++) {
      if (manh(a[i], b[i], c[j], d[j]) < dmin) {
        pnum = j + 1;
        dmin = manh(a[i], b[i], c[j], d[j]);
      }
    }
    printf("%d\n", pnum);
  }
  return 0;
}
int manh(int x1, int y1, int x2, int y2) {
  if (x1 < x2 && y1 < y2) {
    return (x2 - x1 + y2 - y1);
  } else if (x1 < x2 && y1 >= y2) {
    return (x2 - x1 + y1 - y2);
  } else if (x1 >= x2 && y1 < y2) {
    return (x1 - x2 + y2 - y1);
  } else if (x1 >= x2 && y1 >= y2) {
    return (x1 - x2 + y1 - y2);
  }
}
