n,m=map(int,input().split())
a=[list(map(int,input().split())) for a in range(n)]
c=[list(map(int,input().split())) for b in range(m)]
print(a)
print(c)
dist=0
minnum=0
for indi,i in enumerate(a):
    dist=0
    min=10*14
    for indj,j in enumerate(c):
        dist+=abs(i[0]-j[0])
        dist+=abs(i[1]-j[1])
        if min>dist:
            min=dist
            minnum=indj
            print(dist)
        dist=0 
    print(minnum+1)