#include <bits/stdc++.h>
int main(void) {
  int n, m, i, j, min, tmp, jj;
  scanf("%d%d", &n, &m);
  int a[n], b[n], c[m], d[m];
  for (i = 0; i < n; i++) scanf("%d%d", &a[i], &b[i]);
  for (i = 0; i < m; i++) scanf("%d%d", &c[i], &d[i]);
  for (i = 0; i < n; i++) {
    tmp = 10000000;
    for (j = 0; j < m; j++) {
      if (c[j] > a[i])
        min = c[j] - a[i];
      else
        min = a[i] - c[j];
      if (d[j] > b[i])
        min += d[j] - b[i];
      else
        min += b[i] - d[j];
      if (tmp > min) {
        tmp = min;
        jj = j + 1;
      }
    }
    printf("%d\n", jj);
  }
  return 0;
}
