n,m=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
ans=10000000
ans1=0
tmp=0
for i in range(n):
    x,y=map(int,input().split())
    a.append(x)
    b.append(y)
for i in range(m):
    x,y=map(int,input().split())
    c.append(x)
    d.append(y)
for i in range(n):
    for j in range(m):
        tmp=abs(a[i]-c[j])+abs(b[i]-d[j])
        if ans>tmp:
            ans1=j+1
            ans=tmp
    print(ans1)
    ans=10000000
