N, M = map(int, input().split())

AB = []

for _ in range(N):
    AB.append(list(map(int, input().split())))

CD = []

for _ in range(M):
    CD.append(list(map(int, input().split())))

for i in range(N):
    distance = 10**8+7
    for j in range(M)[::-1]:
        temp = abs(AB[i][0] - CD[j][0]) + abs(AB[i][1] - CD[j][1])
        # print(AB[i][0] - CD[j][0],AB[i][1] - CD[j][1])
        # print('temp=',temp,'j=',j)
        if temp <= distance:
            distance = temp
            ans = j+1
            # print('ans=',ans)
    print(ans)