n,m=map(int,input().split())
al=[]
bl=[]
ansl=[]
for i in range(n):
  al.append(input())
for i in range(m):
  bl.append(input())
for i in range(n):
  a1,a2=map(int,al[i].split())
  b1,b2=map(int,bl[0].split())
  mi=dis=abs(b1-a1)**2+abs(b2-a2)**2
  c=1
  for j in range(1,m):
    b1,b2=map(int,bl[j].split())
    dis=abs(b1-a1)**2+abs(b2-a2)**2
    if mi>dis:
      mi=dis
      c=j+1
  ansl.append(c)
for i in range(len(ansl)):
  print(ansl[i])