# -*- coding: utf-8 -*-
# get two integers separated with half-width break
N, M = map(int, raw_input().split())
n = []
m = []
for i in range(N):
    n.append(map(int, raw_input().split()))

for i in range(M):
    m.append(map(int, raw_input().split()))

for i in range(N):
    distances = [abs(n[i][0] - m[j][0]) + abs(n[i][1] - m[j][1]) for j in range(M)]
    print(distances.index(min(distances)) + 1)
