n, m = map(int, input().split())
list_student = []
list_ckeckpoint = []
for x in range(n):
    a, b = map(int, input().split())
    list_student.append([a, b])
for y in range(m):
    c, d = map(int, input().split())
    list_ckeckpoint.append([c, d])
    
def distance(lista, listb):
    return abs(lista[0] - listb[0]) + abs(lista[1] - listb[1])

for no in range(n):
    minValue = 10**8
    minid = 1
    for id in range(m):
        dis = distance(list_student[no], list_ckeckpoint[id])
        if minValue > dis: minid = id + 1
        minValue = min([minValue, dis])
    print(minid)