N,M = map(int,input().split())

a = [0]*N
b=[0]*N
c = [0]*M
d =[0]*M

for i in range(N):
    a[i],b[i] = map(int,input().split())
    
    
for i in range(M):
    c[i],d[i] = map(int,input().split())
    
    
for i in range(N):
    x = a[i]
    y = b[i]
    result =0
    Min = 10**20
    
    for j in range(M):
        
        cx = c[j]
        cy = d[j]
        
        temp = abs((cx-x)+(cy-y))
        
        if Min > temp:
            result = j+1
            Min = temp
            
            
    print(result)