#include <bits/stdc++.h>
int main() {
  long int small;
  int i, j, pos, n, m, k;
  scanf("%d%d", &n, &m);
  long int a[n], b[n], c[m], d[m], distance[n];
  for (i = 0; i < n; i++) scanf("%ld%ld", &a[i], &b[i]);
  for (i = 0; i < m; i++) scanf("%ld%ld", &c[i], &d[i]);
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      distance[j] = labs(a[i] - c[j]) + labs(b[i] - d[j]);
    }
    small = distance[0];
    pos = 1;
    for (k = 1; k < m; k++) {
      if (distance[k] < small) {
        small = distance[k];
        pos = k + 1;
      }
    }
    printf("%d\n", pos);
  }
  return 0;
}
