n,m=map(int,input().split())
student=[]
for _ in range(n):
    a,b=map(int,input().split())
    student.append((a,b))

point=[]
for _ in range(m):
    a,b=map(int,input().split())
    point.append((a,b))

# 生徒単位でチェック
for sx,sy in student:
    dist=2*10**8
    pnum=0
    for i, p in enumerate(point):
        px,py=p[0],p[1]
        pdist=abs(sx-px)+abs(sy-py)
        if pdist<dist:
            dist=pdist
            pnum=i+1
    print(pnum)