N,M = map(int,input().split())
Ls = []
Lp = []
for i in range(N):
    a,b = map(int,input().split())
    Ls.append(a)
    Ls.append(b)
for m in range(M):
    c,d = map(int,input().split())
    Lp.append(c)
    Lp.append(d)
for i in range(N):
    dis = []
    for m in range(M):
        dis.append(abs(Ls[i][0]-Lp[m][0])+abs(Ls[i][1]-Lp[m][1]))
    print(dis.index(min(dis))+1)