#include<stdio.h>
#include<stdlib.h>

int main(){
 unsigned N, M;
 int *a, *b, *c, *d;
 unsigned ml, m, l;

 scanf("%d%d", &N, &M);
 a = (int *)malloc(sizeof(int) * N);
 b = (int *)malloc(sizeof(int) * N);
 c = (int *)malloc(sizeof(int) * M);
 d = (int *)malloc(sizeof(int) * M);
 for(unsigned i = 0; i < N; i++) scanf("%d%d", a + i, b + i);
 for(unsigned i = 0; i < M; i++) scanf("%d%d", c + i, d + i);

 for(unsigned i = 0; i < N; i++){
  ml = unsigned(-1);
  for(unsigned j = 0; j < M; j++){
   l = std::abs(a[i] - c[j]) + std::abs(b[i] - d[j]);
   if(ml > l){
    ml = l;
    m = j;
   }
  }
  printf("%d\n", m + 1);
 }
}