n,m=map(int, input().split())
a=[list(map(int, input().split())) for i in range(n)]
b=[list(map(int, input().split())) for i in range(m)]
for i,j in a:
    dis=10**8
    point=0
    for k in range(len(b)):
        if abs(i-b[k][0])+abs(j-b[k][1])<dis:
            dis=abs(i-b[k][0])+abs(j-b[k][1])
            point=k
    print(point+1)