N,M = map(int,raw_input().split())
A = []
T = []
for i in range(0,N):
        a,b = raw_input().split()
        A.append(a)
        A.append(b)
        T.append(A)
        A = []
B = []
S = []
for i in range(0,M):
        c,d = raw_input().split()
        B.append(c)
        B.append(d)
        S.append(B)
        B = []
ans = []
for i in range(0,N):
        for j in range(0,M):
                t = abs(int(T[i][0])-int(S[j][0])) + abs(int(T[i][1])-int(S[j][1]))
                ans.append(t)
                #print t
        print ans.index(min(ans))+1
        ans = []
        