#include <bits/stdc++.h>
int main(void) {
  int N, M;
  scanf("%d %d", &N, &M);
  int a[N + 1], b[N + 1], c[M + 1], d[M + 1];
  int i, j, ans;
  int distance;
  int min;
  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 = 100000001;
    distance = 0;
    for (j = 0; j < M; j++) {
      distance = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (distance < min) {
        min = distance;
        ans = j + 1;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
