N,M = map(int,input().split())

a = [0 for i in range(N)]
b = [0 for i in range(N)]
c = [0 for i in range(M)]
d = [0 for i in range(M)]

for i in range(N):
    a[i],b[i] = map(int,input().split())

for i in range(M):
    c[i],d[i] = map(int,input().split())

for i in range(N):
    for j in range(M):
        dist = []
        tmp = abs(a[i]-c[i]) + abs(b[i]-d[i])
        dist.append(tmp)

    print(dist.index(min(dist)))