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