#include <bits/stdc++.h>
int main(void) {
  register int i, j;
  int n, m;
  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]);
  long mindist[n], minchptr[n];
  for (i = 0; i < n; ++i) {
    mindist[i] = 200000001;
    for (j = m - 1; j >= 0; --j) {
      long curdist = ((a[i] - c[j]) < 0 ? -(a[i] - c[j]) : (a[i] - c[j])) +
                     ((b[i] - d[j]) < 0 ? -(b[i] - d[j]) : (b[i] - d[j]));
      if (curdist <= mindist[i]) {
        mindist[i] = curdist;
        minchptr[i] = j;
      }
    }
  }
  for (i = 0; i < n; ++i) printf("%ld\n", minchptr[i] + 1);
}
