#include <bits/stdc++.h>
int main(void) {
  int n, m, a[50], b[50], c[50], d[50], s[50], i, j, x, y, xy, min;
  scanf("%ld%ld", &n, &m);
  for (i = 1; i <= n; i++) scanf("%ld%ld", &a[i], &b[i]);
  for (j = 1; j <= m; j++) scanf("%ld%ld", &c[j], &d[j]);
  for (i = 1; i <= n; i++) {
    x = a[i] - c[1];
    if (x < 0) x = -x;
    y = b[i] - d[1];
    if (y < 0) y = -y;
    min = x + y;
    s[i] = 1;
    for (j = 2; j <= m; j++) {
      x = a[i] - c[j];
      if (x < 0) x = -x;
      y = b[i] - d[j];
      if (y < 0) y = -y;
      xy = x + y;
      if (min > xy) {
        min = xy;
        s[i] = j;
      }
    }
  }
  for (i = 1; i <= n; i++) printf("%ld\n", s[i]);
  return 0;
}
