def ri():
    return map(int, raw_input().split())

n,m = ri()
students = [ri() for _ in range(n)]
checkpoints = [ri() for _ in range(m)]
for a,b in students:
    idx = -1
    dist = 10**9
    for i,(c,d) in enumerate(checkpoints):
        tmp = abs(c-a) + abs(d-b)
        if tmp < dist:
            dist = tmp
            idx = i
    print idx + 1
