n, m = map(int, input().split())

ab = []
for i in range(n):
    temp = map(int, input().split())
    ab.append(tuple(temp))

cd = []
for j in range(m):
    temp = map(int, input().split())
    cd.append(tuple(temp))

d = [False for i in range(m)]


for i in ab:
    temp_ind = -1
    temp = 10 ** 17
    for ind, j in enumerate(cd):
        md = abs(i[0]-j[0])+abs(i[1]-j[1])
        if md < temp:
            if d[ind] == False:
                temp_ind = ind
                temp = abs(i[0]-j[0])+abs(i[1]-j[1])
    d[temp_ind] = True
    print(temp_ind+1)