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)]

ans = [0 for i in range(n)]
for i in range(n):
    distance = 1e8
    tmp_ans = 1
    for j in range(m):
        tmp_dis = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])
        if distance > tmp_dis:
            distance = tmp_dis
            tmp_ans = j + 1
    print(tmp_ans)