a, b = map(int, input().split())
c = [list(map(int, input().split()))for _ in range(a)]
d = [list(map(int, input().split()))for _ in range(b)]
e = []

for i in range(a):
    f = 10 * 9
    g = 0
    for j in range(b):
        if f > abs(c[i][0] - d[j][0]) + abs(c[i][1] - d[j][1]):
            f = abs(c[i][0] - d[j][0]) + abs(c[i][1] - d[j][1])
            g = j
    e.append([g+1, f])
for i in range(len(e)):
    print(e[i][0])