# coding: utf-8
N, M = map(int, input().split())
st = [list(map(int, input().split())) for _ in range(N)]
ch = [list(map(int, input().split())) for _ in range(M)]
for i, j in st:
    min = 10 ** 8
    min_num = 0
    for num, xy in enumerate(ch):
        if abs(i - xy[0]) + abs(j - xy[1]) < min:
            min = abs(i - xy[0]) + abs(j - xy[1])
            min_num = num + 1
    print(min_num)
