#include <bits/stdc++.h>
int dist(int x1, int y1, int x2, int y2) { return abs(x1 - y1) + abs(x2 - y2); }
int main() {
  int n, m;
  if (scanf("%d %d", &n, &m) == 2) {
    int ab[n][2], cd[m][2], abA[n];
    memset(ab, 0, n * 2 * sizeof(int));
    memset(cd, 0, m * 2 * sizeof(int));
    memset(abA, INT_MAX, n * sizeof(int));
    for (int i = 0; i < n; i++) scanf("%d %d", &ab[i][0], &ab[i][1]);
    for (int i = 0; i < m; i++) scanf("%d %d", &cd[i][0], &cd[i][1]);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++)
        abA[i] = dist(ab[i][0], cd[j][0], ab[i][1], cd[j][1]) <
                         dist(ab[i][0], cd[abA[i]][0], ab[i][1], cd[abA[i]][1])
                     ? j
                     : abA[i];
    }
    for (int i = 0; i < n; i++) printf("%d\n", abA[i] + 1);
  }
  return 0;
}
