N, M = map(int, input().split())
ab = [map(int, input().split()) for _ in range(N)]
a, b = zip(*ab)
cd = [map(int, input().split()) for _ in range(M)]
c, d = zip(*cd)

for i in range(N):
    tmp_dist = 10 ** 8
    tmp_point = 0
    for j in range(M):
        if tmp_dist > abs(a[i] - c[j]) + abs(b[i] - d[j]):
            tmp_point = j + 1
        tmp_dist = min(tmp_dist, abs(a[i] - c[j]) + abs(b[i] - d[j]))
        
    else:
        print(tmp_point)