#include <bits/stdc++.h>
int manhattan(int x1, int x2, int y1, int y2);
int main() {
  int n, m, *a, *b, *c, *d;
  int i, j, temp, min, minj;
  scanf("%d%d", &n, &m);
  a = (int *)malloc(sizeof(int) * n);
  b = (int *)malloc(sizeof(int) * n);
  c = (int *)malloc(sizeof(int) * m);
  d = (int *)malloc(sizeof(int) * m);
  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++) {
    min = manhattan(a[i], b[i], c[0], d[0]);
    minj = 0;
    for (j = 1; j < n; j++) {
      temp = manhattan(a[i], b[i], c[j], d[j]);
      if (temp < min) {
        min = temp;
        minj = j;
      }
    }
    printf("%d\n", minj + 1);
  }
  return 0;
}
int manhattan(int x1, int y1, int x2, int y2) {
  return (abs(x1 - x2) + abs(y1 - y2));
}
