N, M = map(int, input().split())
stu = []
check = []
for i in range(N):
    s = list(map(int, input().split()))
    stu.append(s)
for i in range(M):
    c = list(map(int, input().split()))
    check.append(c)
ans = [0 for i in range(N)]
for i in range(N):
    min = 1000000
    for j in range(M):
        dis = abs(stu[i][0]-check[j][0])+abs(stu[i][1]-check[j][1])
        if min > dis:
            min = dis
            ans[i] = j+1
for i in ans:
    print(i)
