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