#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, k, min, mindex;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) {
    scanf("%d", a + i, b + i);
  }
  for (i = 0; i < m; i++) {
    scanf("%d", c + i, b + i);
  }
  for (i = 0; i < n; i++) {
    min = 0;
    mindex = 0;
    for (j = 0; j < m; j++) {
      if (min < abs(a[i] - c[j]) - abs(b[i] - c[j])) {
        min = abs(a[i] - c[j]) - abs(b[i] - c[j]);
        mindex = j;
      }
    }
    answer[i] = mindex + 1;
  }
  for (i = 0; i < n; i++) {
    printf("%d\n", answer[i]);
  }
  return 0;
}
