N,M = map(int,input().split())
A = []
B = []
C = []
D = []
ans = []

for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)

for j in range(M):
    c,d = map(int,input().split())
    C.append(c)
    D.append(d)

for i in range(N):
    item = abs(A[i]-C[0])-abs(B[i]-D[0])
    index = 1
    for j in range(M):
        if item > abs(A[i]-C[j])-abs(B[i]-D[j]):
            item = abs(A[i]-C[j])-abs(B[i]-D[j])
            index = j+1
    ans.append(index)

for i in range(len(ans)):
    print(ans[i])
