def Distance(t_a,t_b):
    return abs(t_a[0]-t_b[0]) + abs(t_a[1]-t_b[1])

n,m = map(int,input().split(' '));
students = []
for p in range(n):
    students.append(tuple(map(int,input().split(' '))))
check = []
for q in range(m):
    check.append(tuple(map(int,input().split(' '))))
ans = ''
for s in students:
    dmin = Distance(s, check[0])
    dindex = 0
    i = 1
    while i < m:
        d0 = Distance(s, check[i])
        if d0 < dmin:
            dmin = d0
            dindex = i
        i += 1
    ans += str(dindex) + '\n'
print(ans)
        