n, m = map(int, input().split())
stu = []
chp = []
for _ in range(n):
    a, b = map(int, input().split())
    stu.append([a, b])
for _ in range(m):
    c, d = map(int, input().split())
    chp.append([c, d])

ans = [] 
for i in range(n):
    mn = 10**8
    idx = 0
    for j in range(m):
        p = abs(stu[i][0] - chp[j][0]) + abs(stu[i][1] - chp[j][1])
        if p < mn:
            mn = p
            idx = j + 1
    ans.append(idx)
    
for i in range(n):
    print(ans[i])