n,m = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
for i in range(m):
    c,d = map(int,input().split())
    l = [0]*n
    for i in range(n):
        l[i] = abs(a[i][0]-c)+abs(a[i][1]-d)
    print(l.index(min(l))+1)
