n,m=map(int,input().split())
stu=[]
far=[]
for i in range(n):
    a,b=map(int,input().split())
    stu.append([a,b])
for i in range(m):
    c,d=map(int,input().split())
    far=[]
    ans=0
    for j in range(n):
        far.append(abs(stu[j][0]-c)+abs(stu[j][1]-d))
    print(far.index(min(far))+1)