n,m = map(int,input().split())
x = [0]*n
y = [0]*n
mx = [0]*m
my = [0]*m
for i in range(n):
    x[i],y[i] = map(int,input().split())
for j in range(m):
    mx[j],my[j] = map(int,input().split())
ans = [0]*n
for k in range(n):
    dis = 1000000000
    cnt = 1
    for l in range(n):
        if abs(x[k]-mx[l])+abs(y[k]-my[l]) < dis:
            dis = abs(x[k]-mx[l])+abs(y[k]-my[l])
            cnt = l+1
    ans[k] = cnt
for h in ans:
    print(h)