n,m=map(int,input().split())
a=[tuple(map(int,input().split()))for i in range(n)]
b=[tuple(map(int,input().split()))for j in range(m)]
total=10**8+10**8
num=0
ans=[]
for i in range(n):
    for j in range(m):
        dis=abs(a[i][0]-b[j][0])+abs(a[i][1]-b[j][1])
        if dis<total:
            total=dis
            num=j+1
    ans.append(num)
    num=0
    total=10**8+10**8
for i in ans:
    print(i)
