n, m = map(int, input().split())
a = []
b = []
c = []
d = []
for i in range(n):
    temp = list(map(int, input().split()))
    a.append(temp[0])
    b.append(temp[1])


for i in range(m):
    temp = list(map(int, input().split()))
    c.append(temp[0])
    d.append(temp[1])

ans = []

for i in range(n):
    min_dis = 1000
    for j in range(m):

        distance = abs(c[j] - a[i]) + abs(d[j] - b[i])

        #print("学生{}, {} チェックポイント{}, {}".format(a[i], b[i], c[j], d[j]))
        #print("距離番号{} = {}".format(j, distance))
        
        if min_dis > distance:
            min_dis = distance
            min_num = j
            #print("更新")
        
    ans.append(min_num)
    
for i in range(n):
    print(ans[i] + 1)
