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

for i in range(n):
    aa,bb = map(int,input().split())
    a.append(aa)
    b.append(bb)

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

for i in range(n):
    num = 1
    ans = 0
    min_man = 10000
    for j in range(m):
        man = abs(a[i]-c[j])+abs(b[i]-d[j])
        if min_man > man:
            min_man = man
            ans = num
        num+=1
    print(ans)