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

stu = [list(map(int,input().split())) for i in range(n)]

check = [list(map(int,input().split())) for i in range(m)]

mini = [2*10**8]*n
index = [0]*n

for i in range(n):
    for j in range(m):
        dist = abs(stu[i][0]-check[j][0]) + abs(stu[i][1]-check[j][1])
        if dist < mini[i]:
            mini[i] = dist
            index[i] = j+1
    
    
            
for i in index:
    print(i)