#include <bits/stdc++.h>
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int aluno[n][2];
  int coor[m][2];
  for (int i = 0; i < n; ++i) scanf("%d %d", &aluno[i][0], &aluno[i][1]);
  for (int i = 0; i < m; ++i) scanf("%d %d", &coor[i][0], &coor[i][1]);
  for (int i = 0; i < n; ++i) {
    int menor = 100000000;
    int k;
    for (int j = 0; j < m; ++j) {
      int x = (abs(aluno[i][0] - coor[j][0]) + abs(aluno[i][1] - coor[j][1]));
      if (x < menor) {
        menor = x;
        k = j + 1;
      }
    }
    printf("%d\n", k);
  }
  return 0;
}
