n, m = map(int, input().split())
a = []
b = []
for _ in range(n):
    aa, bb = map(int, input().split())
    a.append(aa)
    b.append(bb)

c = []
d = []
for _ in range(m):
    cc, dd = map(int, input().split())
    c.append(cc)
    d.append(dd)

for aa, bb in zip(a, b):
    l = 2 * 10 ** 8
    num = 0
    for i, (cc, dd) in enumerate(zip(c, d)):
        dis = abs(aa - cc) + abs(bb - dd)
        if dis < l:
            l = dis
            num = i + 1
    print(num)