#include <bits/stdc++.h>
int abs(int x, int y) {
  int s = x - y;
  if (s < 0)
    return -s;
  else
    return s;
}
struct stu {
  int ai, bi;
};
stu a[100], b[100];
int minn = 100000000, n, m, i, j, k;
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d%d", &a[i].ai, &a[i].bi);
  for (i = 1; i <= m; i++) scanf("%d%d", &b[i].ai, &b[i].bi);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (minn > (abs(a[i].ai, b[j].ai) + abs(a[i].bi, b[j].bi)))
        minn = (abs(a[i].ai, b[j].ai) + abs(a[i].bi, b[j].bi)), k = j;
    }
    printf("%d\n", k), minn = 100000000;
  }
}
