#include <bits/stdc++.h>
int main(void) {
  int n, m, i, j;
  scanf("%d %d", &n, &m);
  long a[n], b[n], c[m], d[m];
  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++) {
    long min = 400000000;
    int cp = 0;
    for (j = 0; j < n; j++) {
      long ksum = labs(c[j] - a[i]) + labs(d[j] - b[i]);
      if (min > ksum) {
        min = ksum;
        cp = j;
      }
    }
    printf("%d\n", cp + 1);
  }
  return 0;
}
