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

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

for i in range(n):
    min = 100000000
    p = 1
    for j in range(m):
        z = abs(a[i] - c[j]) + abs(b[i] - d[j])
        if z < min:
            min = z
            p = j + 1

    print(p)