#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int n, m, a[50], b[50], c[50], d[50], answer[50];
  int i, j, min, mindex, temp;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) {
    scanf("%d%d", a + i, b + i);
  }
  for (i = 0; i < m; i++) {
    scanf("%d%d", c + i, d + i);
  }
  for (i = 0; i < n; i++) {
    min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
    mindex = 0;
    for (j = 1; j < m; j++) {
      temp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (min > temp) {
        min = temp;
        mindex = j;
      }
    }
    answer[i] = mindex + 1;
  }
  for (i = 0; i < n; i++) {
    printf("%d\n", answer[i]);
  }
  return 0;
}
