#include <bits/stdc++.h>
int main(void) {
  int n, m, i, j, row = -1, t;
  long int a[100] = {}, b[100] = {}, c[100] = {}, d[100] = {}, e, f, g, h, sum,
           sum2, min = 100000000, ans;
  scanf("%d %d", &n, &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++) {
    e = a[i];
    f = b[i];
    for (j = 0; j < m; j++) {
      g = c[j];
      h = d[j];
      sum = labs(e - g);
      sum2 = labs(f - h);
      ans = sum + sum2;
      if (ans < min) {
        min = ans;
        t = j + 1;
      }
    }
    printf("%d\n", t);
    min = 100000000;
  }
  return 0;
}
