#include <bits/stdc++.h>
int dis[50][2], chk[50][2], dst[50], n, m, mindst;
int min(int a, int b) { return a < b ? a : b; }
int dist(int aluno) {
  int x1 = dis[aluno][0], y1 = dis[aluno][1];
  mindst = 123456789;
  for (int i = 0; i < m; ++i) {
    int x2 = chk[i][0], y2 = chk[i][1];
    dst[i] = abs(x1 - x2) + abs(y1 - y2);
    mindst = min(mindst, dst[i]);
  }
  for (int i = 0; i < m; ++i) {
    if (dst[i] == mindst) return i;
  }
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &dis[i][0], &dis[i][1]);
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &chk[i][0], &chk[i][1]);
  }
  for (int i = 0; i < n; ++i) {
    printf("%d\n", dist(i) + 1);
  }
  return 0;
}
