#include <bits/stdc++.h>
int main() {
  int N, M;
  scanf("%d %d", &N, &M);
  int a[N + 1];
  int b[N + 1];
  int c[M + 1];
  int d[M + 1];
  long long dis = 10000000;
  int num = 1;
  for (int i = 1; i <= N; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  for (int j = 1; j <= M; j++) {
    scanf("%d %d", &c[j], &d[j]);
  }
  for (int k = 1; k <= N; k++) {
    for (int l = 1; l <= M; l++) {
      if (dis > (abs(a[k] - c[l]) + abs(b[k] - d[l]))) {
        num = l;
        dis = abs(a[k] - c[l]) + abs(b[k] - d[l]);
      }
    }
    printf("%d\n", num);
    dis = 10000000;
    num = 1;
  }
  return 0;
}
