n,m = map(int,input().split())
a = [i for i in range(n)]
b = [i for i in range(n)]
c = [i for i in range(m)]
d = [i for i in range(m)]
t = [10**8 for i in range(n)]
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())
check = [0 for i in range(n)]
for i in range(n):
    for j in range(m):
        if t[i] > abs(a[i]-c[j]) + abs(b[i]-d[j]):
            check[i] = j
            t[i] = abs(a[i]-c[j]) + abs(b[i]-d[j])
for i in range(n):
    print(check[i]+1)