N, M = map(int, input().split())
a, b, c, d = [0]*N, [0]*N, [0]*M, [0]*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())

s = [0]*N
index = [0]*N
for i in range(N):
    s[i] = abs(a[0]-c[0]) + abs(b[0]-d[0])
    for j in range(M):
        if abs(a[i]-c[j]) + abs(b[i]-d[j]) < s[i]:
            s[i] = abs(a[i]-c[j]) + abs(b[i]-d[j])
            index[i] = j + 1

for i in range(N):
    print(index[i])


