N,M = map(int,input().split())

a = [0]*N
b = [0]*N

for i in range(N):
    a[i],b[i] = map(int,input().split())

x = [0]*M
y = [0]*M

for  i in range(M):
    x[i],y[i]= map(int,input().split())

for i in range(N):
    dis = 10000000000000000
    for j in range(M):
        dis = min(dis,(abs(a[i]-x[j])+abs(b[i]-y[j])))
        res = i

    print(res+1)
