n,m=raw_input().split(' ')
n=int(n)
m=int(m)

students=[]
for _ in range(n):
    x,y=raw_input().split(' ')
    students.append((int(x),int(y)))

checkpoint=[]
for _ in range(m):
    x,y=raw_input().split(' ')
    checkpoint.append((int(x),int(y)))

for s in students:
    min_d=99999999999
    min_num=0
    for i,c in enumerate(checkpoint):
        if abs(c[0]-s[0])+abs(c[1]-s[1]) < min_d:
            min_d=abs(c[0]-s[0])+abs(c[1]-s[1])
            min_num=i

    print min_num+1
    

