import numpy as np



N, M = list(map(int, input().split()))



ab = []

for i in range(N):

    tmp = list(map(int, input().split()))

    ab.append(tmp)



ab = np.array(ab)

dist = np.full([N, M], np.inf)



for m in range(M):

    tmp = np.array(list(map(int, input().split())))

    for n in range(N):

        dist[n, m] = np.abs(ab[n] - tmp).sum()



dist = dist.astype("int")



for d in dist:

    print((d.argmin()+1))
import numpy as np



n, m = map(int, input().split())



ab = []

for _ in range(n):

    a, b = map(int, input().split())

    ab.append((a, b))



result = np.zeros([m, n], dtype=np.int64)



cd = []

for i in range(m):

    c, d = map(int, input().split())

    for j, (a, b) in enumerate(ab):

        result[i, j] = abs(a - c) + abs(b - d)



print(*result.argmin(axis=0) + 1, sep="\n")

import numpy as np

N, M = list(map(int, input().split()))
ab = []
for i in range(N):
    tmp = list(map(int, input().split()))
    ab.append(tmp)
ab = np.array(ab)
dist = np.full([N, M], np.inf)
for m in range(M):
    tmp = np.array(list(map(int, input().split())))
    for n in range(N):
        dist[n, m] = np.abs(ab[n] - tmp).sum()
dist = dist.astype("int")
for d in dist:
    print((d.argmin() + 1))

import numpy as np

n, m = map(int, input().split())
ab = []
for _ in range(n):
    a, b = map(int, input().split())
    ab.append((a, b))
result = np.zeros([m, n], dtype=np.int64)
cd = []
for i in range(m):
    c, d = map(int, input().split())
    for j, (a, b) in enumerate(ab):
        result[i, j] = abs(a - c) + abs(b - d)
print(*result.argmin(axis=0) + 1, sep="\n")

-N, M = list(map(int, input().split())) +n, m = map(int, input().split()) -for i in range(N): -    tmp = list(map(int, input().split())) -    ab.append(tmp) -ab = np.array(ab) -dist = np.full([N, M], np.inf) -for m in range(M): -    tmp = np.array(list(map(int, input().split()))) -    for n in range(N): -        dist[n, m] = np.abs(ab[n] - tmp).sum() -dist = dist.astype("int") -for d in dist: -    print((d.argmin() + 1)) +for _ in range(n): +    a, b = map(int, input().split()) +    ab.append((a, b)) +result = np.zeros([m, n], dtype=np.int64) +cd = [] +for i in range(m): +    c, d = map(int, input().split()) +    for j, (a, b) in enumerate(ab): +        result[i, j] = abs(a - c) + abs(b - d) +print(*result.argmin(axis=0) + 1, sep="\n")