
import sys

a, b, x, y = [], [], [], []
oo = 168430090

def rdl():
	return map(int, raw_input().split())


def mht(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)


#sys.stdin = open("test.in", "r")
n, m = rdl()
for i in range(n):
	l, r = rdl()
	x.append(l), y.append(r)

for i in range(m):
	l, r = rdl()
	a.append(l), b.append(r)

for i in range(n):
	mn, mnid = oo, 0
	for j in range(m):
		if mht(x[i], y[i], a[j], b[j]) < mn:
			mn = mht(x[i], y[i], a[j], b[j])
			mnid = j
	
	print mnid + 1


