#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"(n,m),*a=[list(map(int,s.split()))for s in open(0).readlines(0)]\n"
"for i,j in a[:n]:l=[abs(x-i)+abs(y-j)for x,y in a[n:]];print(1+l.index(min(l)))\n"
"\"";
  system(s);
  return 0;
}            