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

ans = 50
distance = 0

for i in range(n):
    for j in range(m):
        e = abs(a[i]-c[j])+abs(b[i]-d[j])
        if distance == 0:
            distance = e
            ans = j
        elif distance > e:
            distance = e
            ans = j
    print(ans+1)
    ans = 50
    distance = 0