
m,n = map(int,input().split())#m学生 nチェックポイント
student = []
checkpoint = []
for i in range(n):
    student.append(list(map(int,input().split())))
for i in range(m):
    checkpoint.append(list(map(int,input().split())))

for i in range(m):
    ans = 0 #答えの初期化
    tmp = 10000000000000
    for j in range(n):
        if tmp > abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1]):
            ans = i
            tmp = abs(student[i][0] - checkpoint[i][0]) + abs(student[i][1] - checkpoint[i][1])
    print(ans+1)
