#include <bits/stdc++.h>
int main() {
  int n, m, gakusei[51][3], point[51][3], s, t = 101, u, i, j;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++)
    for (j = 0; j < 2; j++) scanf("%d", &gakusei[i][j]);
  for (i = 0; i < m; i++)
    for (j = 0; j < 2; j++) scanf("%d", &point[i][j]);
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      s = abs(gakusei[i][0] - point[j][0]) + abs(gakusei[i][1] - point[j][1]);
      if (t > s) {
        t = s;
        u = j;
      }
    }
    printf("%d\n", u + 1);
    t = 101;
  }
  return 0;
}
