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