#include <bits/stdc++.h>
int main(void) {
  int n, m, a[60], b[60], c[60], d[60];
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a[i], &b[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &c[i], &d[i]);
  }
  for (int i = 0; i < n; i++) {
    int anslong = 200000000;
    int ans = 0;
    for (int j = 0; j < m; j++) {
      int tmp;
      tmp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (tmp < anslong) {
        anslong = tmp;
        ans = j + 1;
      }
    }
    printf("%d\n", ans);
  }
}
