n,m = map(int, raw_input().split())

stu = []
for _ in range(n):
    stu.append((map(int, raw_input().split())))

che = []
for _ in range(m):
    che.append((map(int, raw_input().split())))


for st in range(n):
    min_dis = float("inf")
    idx = -1
    for ch in range(m):
        dist = abs(stu[st][0] - che[ch][0]) + abs(stu[st][1] - che[ch][1])
        if dist < min_dis:
            min_dis = dist
            idx = ch
    print idx + 1
