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

for i in range(N):
    check = 10**5
    ans = 51
    for j in range(M):
        if abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]) < check:
            ans = j+1
            check = min(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]), check)
    print(ans)