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

list_a = []
list_b = []
count = 0

for i in range(N):
    a = [int(i) for i in input().split()]
    list_a.append(a)
    
for i in range(M):
    b = [int(i) for i in input().split()]
    list_b.append(b)
    
for i in range(N):
    ans_x = 10**8
    for j in range(M):
        x = abs(list_a[i][0]-list_b[j][0])
        y = abs(list_a[i][1]-list_b[j][1])
        xxx = x + y
        if xxx < ans_x:
            ans_x = xxx
            count = j+1
    print(count)


    