n,m = map(int, input().split())
ab = []
cd = []
for _ in range(n):
    ab.append(list(map(int, input().split())))
for _ in range(m):
    cd.append(list(map(int, input().split())))
    
for a,b in ab:
    dis = int(1e8)
    ans = -1
    for i in range(m):      
        c,d = cd[m-i-1][0], cd[m-i-1][1]
        manhattan = abs(a-c) + abs(b-d)
        if dis >= manhattan:
            ans = m-i
            dis = manhattan
    print(ans)
        