N, M = list(map(int, input().split()))
a = []
b = []
c = []
d = []
for i in range(N):
    aa, bb = list(map(int, input().split()))
    a.append(aa)
    b.append(bb)

for i in range(M):
    cc, dd = list(map(int, input().split()))
    c.append(cc)
    d.append(dd)

ans = []
for i in range(N):
    x = a[i]
    y = b[i]
    ind = 0
    distance = 100000
    for j in range(M):
        if(distance > abs(x - c[j]) + abs(y - d[j])):
            ind = j
            distance = abs(x - c[j]) + abs(y - d[j])
    ans.append(ind)

for i in range(N):
    print(ans[i])
