n,m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]

for a,b in ab:
    ans = [0,10**8+1]
    for i in range(m):
        c,d = cd[i][0], cd[i][1]
        if abs(a-c) + abs(b-d) < ans[1]:
            ans = [i, abs(a-c) + abs(b-d)]
    print(ans[0]+1)