n,m=map(int,input().split())
a=[]
b=[]
for i in range(n):
    s,t=map(int,input().split())
    a.append(s)
    b.append(t)

for i in range(m):
    c,d=map(int,input().split())
    min=10**9+1
    arg=0
    for j in range(n):
        sum_=abs(c-a[j])+abs(d-b[j])
        if min>sum_:
            min=sum_
            arg=j+1
    print(arg)