import math

N, M = map(int, raw_input().split())
a = []
for i in range(N+M):
    a.append(map(int, raw_input().split()))

b=[]

def mhtn(a,b,c,d):
    return 

for i in range(N):
    best=4*10e8
    num=0
    for j in range(M):
        x=math.fabs(a[i][0]-a[N+j][0])+math.fabs(a[i][1]-a[N+j][1])
        
        if(best>x):
            best=x
            num=j+1
    b.append(num)

for i in b:
    print i