n,m = (int(i) for i in input().split())
ab = [[int(i) for i in input().split()] for i in range(n)]
cd = [[int(i) for i in input().split()] for i in range(m)]

for a,b in ab:
    ans,distance = 0,float('inf')
    for i,cont in enumerate(cd):
        c,d = cont
        #print(abs(a-c)+abs(b-d))
        if distance > abs(a-c)+abs(b-d):
            ans = i
            distance = abs(a-c)+abs(b-d)
    print(ans+1)
    cd[ans] = [float('inf'),float('inf')]
