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())
c = [0] * M
d = [0] * M
for i in range(M):
    c[i], d[i] = map(int, input().split())


for i in range(N):
    distance = abs(a[0] - c[0]) + abs(b[0] - d[0])
    check_point = 1
    for j in range(M):
        temp = abs(a[i] - c[j]) + abs(b[i] - d[j])
        if distance > temp:
            distance = temp
            check_point = j + 1
    print(check_point)