n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]
c = [list(map(int, input().split())) for _ in range(m)]

for i in a:
    mn = 10 ** 8
    record = 0
    for j, v in enumerate(c):
        temp = abs(i[0] - v[0]) + abs(i[1] - v[1])
        if temp < mn:
            mn = temp
            record = j + 1
    print(record)