N, M = map(int,input().split())
ab = []
cd = []
for _ in range(N): ab.append(list(map(int,input().split())))
for _ in range(M): cd.append(list(map(int,input().split())))

def distance(x1, x2, y1, y2):
    return abs(x1 - x2) + abs(y1 - y2)

ans_distance = [float('inf')] * N
ans = [float('inf')] * N
for i in range(N):
    for j in range(M):
        #print(distance(ab[i][0], cd[j][0], ab[i][1], cd[j][1]))
        if ans_distance[i] > distance(ab[i][0], cd[j][0], ab[i][1], cd[j][1]):
            ans_distance[i] = distance(ab[i][0], cd[j][0], ab[i][1], cd[j][1])
            ans[i] = j+1

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