N,M=map(int,input().strip().split(" "))
x=[]
y=[]

for i in range(N):
    c=input().strip().split(" ")
    c=[int(j) for j in c]
    x.append((c[0]))
    y.append((c[1]))
cx=[]
cy=[]

for i in range(M):
    d=input().strip().split(" ")
    d=[int(j) for j in d]
    cx.append((d[0]))
    cy.append((d[1]))

kyori=0

for i in range(N):
    kekka=100000
    basyo=0
    for j in range(M):
        kyori=abs(x[i]-cx[j])+abs(y[i]-cy[j])
        #print(j+1,kyori)
        if(abs(kekka)>abs(kyori) ):
            kekka=kyori
            basyo=j
            
    print(basyo+1)
        
        
