n, m = map(int, raw_input().split())
a, b = [], []
c, d = [], []

for i in range(n):
    a0, b0 = map(int, raw_input().split())
    a.append(a0)
    b.append(b0)
for i in range(m):
    c0, d0 = map(int, raw_input().split())
    c.append(c0)
    d.append(d0)
for i in range(n):
    res = 10**9
    ans = 0
    for j in range(m):
        man = abs(a[i]-c[j])+abs(b[i]-d[j])
        if res > man:
            res = man
            ans = j
    print ans+1