#include <bits/stdc++.h>
int xs[51], ys[51], xc[51], yc[51];
int main(void) {
  int i, j;
  int dis;
  int min;
  int n, m;
  int difx, dify;
  int num;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d %d", &xs[i], &ys[i]);
  }
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &xc[i], &yc[i]);
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      difx = xs[i] - xc[i];
      dify = ys[i] - yc[i];
      if (difx < 0) {
        difx = (-1) * difx;
      }
      if (dify < 0) {
        dify = (-1) * dify;
      }
      dis = difx + dify;
      if (j = 1) {
        min = dis;
        num = 1;
      }
      if (dis < min) {
        min = dis;
        num = j;
      }
    }
    printf("%d\n", num);
  }
  return 0;
}
