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

stu = []
che = []
ans = []

for i in xrange(n):
    a, b = map(int, raw_input().split())
    stu.append((a, b))
    
for i in xrange(m):
    a, b = map(int, raw_input().split())
    che.append((a, b))
    
for i in xrange(n):
    dis = float('inf')
    for j in xrange(m):
        if abs(stu[i][0] - che[j][0]) + abs(stu[i][1] - che[j][1]) < dis:
            index = j
            dis = abs(stu[i][0] - che[j][0]) + abs(stu[i][1] - che[j][1])
    ans.append(index)
    
for i in ans:
    print i+1
    