#include <bits/stdc++.h>
int main(void) {
  int n, m, x, y;
  int nagasa = 2000000000;
  int j, sai;
  scanf("%d %d", &n, &m);
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  int c[m], d[m];
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &c[i], &d[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i] <= c[j]) {
        x = c[j] - a[i];
      } else {
        x = a[i] - c[j];
      }
      if (b[i] <= d[j]) {
        y = d[j] - b[i];
      } else {
        y = b[i] - d[j];
      }
      if (nagasa > (x + y)) {
        nagasa = x + y;
        sai = j + 1;
      }
    }
    printf("%d\n", sai);
    nagasa = 2000000;
  }
  return 0;
}
