#ABC057.B
N,M = int(input().split())
L1 = []
L2 = []

for i in range(N):
    a,b = map(int,input().split())
    L1.append([a,b])
for m in range(M):
    c,d = map(int,input().split())
    L2.append([c,d])

L3 = []
for j in range(N):
    for l in range(M):
        L3.append(abs(L1[j][0]-L2[l][0])+abs(L1[j][1]-L2[l][1]))
    print(L3.index(min(L3[j])+1))