n,m=map(int,input().split())
a=[0]*n
b=[0]*n
c=[0]*m
d=[0]*m
ans=[0]*n

for i in range(n):
    a[i],b[i]=map(int,input().split())
for i in range(m):
    c[i],d[i]=map(int,input().split())
    
for i in range(n):
    dis=[-1]*2
    for j in range(m):
        dis[1]=abs(a[i]-c[j])+abs(b[i]-d[j])
        if (dis[0]<0):
            ans[i]=j+1
        else:
            if (dis[0]>dis[1]):
                ans[i]=j+1
        dis[0]=dis[1]
for i in range(n):
    print(ans[i])