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

n,m = map(int,input().split())
stu = []
for i in range(n):
    a,b = map(int,input().split())
    stu.append([a,b])
ans = [[99,1000000000] for i in range(m)]
#ans[1][1] = 0
#print(ans)
for j in range(1,m+1):
    x,y = map(int,input().split())
    for i in range(n):
        tmp = mh(stu[i][0],stu[i][1],x,y)
        if tmp < ans[i][1]:
            ans[i][0] = j
            ans[i][1] = tmp
for i in range(n):
    print(ans[i][0])
