#include <bits/stdc++.h>
int main() {
  int n, m, menor = 1000000, r, x_aluno[150], y_aluno[150], x_local[150],
            y_local[150], total[150];
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &x_aluno[i], &y_aluno[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &x_local[i], &y_local[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      total[j] = abs(x_aluno[i] - x_local[j]) + abs(y_aluno[i] - y_local[j]);
    }
    for (int k = 0; k < m; k++) {
      if (total[k] < menor) {
        menor = total[k];
        r = k + 1;
      }
    }
    printf("%d\n", r);
    for (int o = 0; o < m + 5; o++) {
      menor = 1000000;
      total[o] = 0;
    }
  }
  return 0;
}
