#include <bits/stdc++.h>
int main(void) {
  int n, m, a[50], b[50], c, d, i, j = 1, min[50], tmp, fl[50];
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &a[i], &b[i]);
    min[i] = 200000001;
  }
  while (m--) {
    scanf("%d %d", &c, &d);
    for (i = 0; i < n; i++) {
      tmp = abs(a[i] - c) + abs(b[i] - d);
      if (tmp <= min[i] && tmp != min[i]) {
        min[i] = tmp;
        fl[i] = j;
      }
    }
    j++;
  }
  for (i = 0; i < n; i++) printf("%d\n", fl[i]);
  return 0;
}
