n,m=map(int,raw_input().split())
ab=[map(int,raw_input().split()) for _ in xrange(n)]
cd=[map(int,raw_input().split()) for _ in xrange(m)]
ans=[]
for i in xrange(n):
    a,b=ab[i]
    tmp=10**12
    idx=-1
    for j in xrange(m):
        c,d=cd[j]
        if abs(a-c)+abs(b-d)<tmp:
            tmp=abs(a-c)+abs(b-d)
            idx=j
    ans.append(idx)
for i in xrange(n):
    print ans[i]+1
