N, M = map(int, input().split())
st = []
ch = []

for i in range(N):
    st.append([*map(int, input().split())])

for i in range(M):
    ch.append([*map(int, input().split())])

for i in range(N):
    x = float('inf')
    c = 0
    
    for j in range(M):
        if abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1]) < x:
            x = abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1])
            c = j+1
    
    print(c)