#include <bits/stdc++.h>
int main(void) {
  int i, j, n, m, a[100], b[100], c[100], d[100], x, y, z, k, t;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &c[i], &d[i]);
  }
  for (i = 1; i <= n; i++) {
    x = 0;
    y = 0;
    t = 100000001;
    k = 0;
    for (j = 1; j <= m; j++) {
      if (c[j] < 0) {
        x = a[i] + (c[j] * -1);
      } else {
        x = a[i] - c[j];
      }
      if (x < 0) {
        x = x * -1;
      }
      if (d[j] < 0) {
        y = b[i] + (d[j] * -1);
      } else {
        y = b[i] - d[j];
      }
      if (y < 0) {
        y = y * -1;
      }
      z = x + y;
      if (z < t) {
        t = z;
        k = j;
      }
    }
    printf("%d\n", k);
  }
  return 0;
}
