n, m = map(int,input().split())
ab = list(list(map(int, input().split())) for _ in range(n))
cd = list(list(map(int, input().split())) for _ in range(m))

for i in range(n):
    for j in range(m):
        num = []
        num.append(abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1]))
    else:
        mini = min(num)
        print(num.index(mini)+1)
        num = []