def dist(a,b,c,d):
    return abs(a-c)+abs(b-d)

N,M=map(int,raw_input().split())
ns=[]
for i in xrange(N):
    a,b=map(int,raw_input().split())
    ns.append((a,b))
ms=[]
for i in xrange(M):
    c,d=map(int,raw_input().split())
    ms.append((c,d))

for a,b in ns:
    mini=None
    idx=None
    cnt=1
    for c,d in ms:
        
        di = dist(a,b,c,d)
        if di < mini or mini==None:
            idx=cnt
            mini=di
        cnt+=1
    print idx
