N, M = map(int, input().split())
ab = [[int(i) for i in input().split()] for i in range(N)]
cd = [[int(i) for i in input().split()] for i in range(M)]
ans = []


for a, b in ab:
    num = float('inf')
    check = 0
    for i in range(M):
        if num > (a - cd[i][0]) ** 2 + (b - cd[i][1]) ** 2:
            num = (a - cd[i][0]) ** 2 + (b - cd[i][1]) ** 2
            check = i + 1
    ans.append(check)

for i in ans:
    print(i)