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

def man_dis(s,d):
    dis = abs(s[0]-d[0]) + abs(s[1]-d[1])
    return dis

res = []
for i in range(int(N)):
    max = 10000000000
    rank = 0
    for j in range(int(M)):
        dis = man_dis(ss[i],ds[j])
        if max > dis:
            rank = j+1
            max = dis
    print(rank)
        