N, M = map(int, input().split())

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

for n in range(N):
    ans = []
    a, b = ab[n]
    for m in range(M):
        c, d = cd[m]
        distance = abs(a - c) + abs(b - d)
        ans.append(distance)
    print(ans.index(min(ans)))