#include <bits/stdc++.h>
int main(void) {
  int n, m;
  int a[50 + 5], b[50 + 5];
  int c[50 + 5], d[50 + 5];
  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 min = abs(a[0] - c[0]) + abs(b[0] - d[0]);
    int checkpoint = 0;
    for (int j = 1; j < m; j++) {
      int dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (min > dist) {
        min = dist;
        checkpoint = j;
      }
    }
    printf("%d\n", checkpoint + 1);
  }
  return 0;
}
