#include <bits/stdc++.h>
typedef struct pos_ {
  int x, y;
} pos;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  pos ab[n + 1];
  pos cd[m + 1];
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &(ab[i].x), &(ab[i].y));
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &(cd[i].x), &(cd[i].y));
  }
  for (int i = 1; i <= n; i++) {
    pos a = ab[i];
    int mind = 100000000;
    int minj = 1;
    for (int j = 1; j <= m; j++) {
      pos c = cd[j];
      int d = abs(a.x - c.x) + abs(a.y - c.y);
      if (d < mind) {
        mind = d;
        minj = j;
      }
    }
    printf("%d\n", minj);
  }
  return 0;
}
