N, M = map(int, raw_input().split())
S = [map(int, raw_input().split()) for _ in xrange(N)]
P = [map(int, raw_input().split()) for _ in xrange(M)]
C = []

def dist(s, p):
	return abs(s[0]-p[0])+abs(s[1]-p[1])

for s in S:
	min_dist = dist(s, P[0])
	min_p = 0
	for i in xrange(1, M):
		d = dist(s, P[i])
		if  d < min_dist:
			min_dist = d
			min_p = i
	C.append(min_p+1)
for c in C:
	print c 
