[N,M] = map(int, raw_input().split())
sl = []
for i in range(N):
    sl.append(map(int, raw_input().split()))
pl = []
for i in range(M):
    pl.append(map(int, raw_input().split()))
ans = []
for (x,y) in sl:
    dmin = 200000001
    imin = -1
    for (i, (px, py)) in enumerate(pl):
        d = abs(x - px) + abs(y - py)
        if(d < dmin):
            dmin = d
            imin = i
    ans.append(imin+1)
for i in ans:
    print i
