n,m=map(int,input().split())
gakusei=[]
for i in range(n):
  gakusei.append(list(map(int,input().split())))
check=[]
for j in range(m):
  check.append(list(map(int,input().split())))

for i in range(0,n):
  minkyori=10*10
  keep=0
  for j in range(0,m):
    kyori=abs(gakusei[i][0]-check[j][0])+abs(gakusei[i][1]-check[j][1])
    if kyori<minkyori:
      minkyori=kyori
      keep=j+1
  print(keep)
    
    