#include <bits/stdc++.h>
int main() {
  int n, m, x1[55], y1[55], x2[55], y2[55], res[55], menor = 100000010, k;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x1[i], &y1[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x2[i], &y2[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      res[j] = abs(x1[i] - x2[j]) + abs(y1[i] - y2[j]);
    }
    for (int j = 0; j < m; j++) {
      if (res[j] < menor) {
        menor = res[j];
        k = j + 1;
      }
    }
    printf("%d\n", k);
    menor = 100000010;
  }
  return 0;
}
