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

a_b = [list(map(int, input().split())) for _ in range(N)]
c_d = [list(map(int, input().split())) for _ in range(M)]

for i in range(N):
    ans = 0
    a = a_b[i][0]
    b = a_b[i][1]

    c_ans = c_d[ans][0]
    d_ans = c_d[ans][1]

    for j in range(M):
        c = c_d[j][0]
        d = c_d[j][1]
        
        if abs(a-c) + abs(b-d) < abs(a-c_ans) + abs(b-d_ans):
             ans = j
        elif abs(a-c) + abs(b-d) == abs(a-c_ans) + abs(b-d_ans):
            ans = j if j<ans else ans
    print(ans+1)