from sys import stdin 
n,m = map(int,stdin.readline().split())
a = []
b = []
valid = [0] * m
for i in xrange(n):
    x,y = map(int,stdin.readline().split())
    a.append((x,y))
for i in xrange(m):
    x,y = map(int,stdin.readline().split())
    b.append((x,y))
for i in xrange(n):
    ans = 10**18 
    ind = -1
    for j in xrange(m):
        #if valid[j]:
         #   continue 
        fir = a[i][0] - b[j][0]
        sec = a[i][1] - b[j][1]
        if fir < 0:
            fir = -fir 
        if sec < 0:
            sec = -sec
        if fir + sec < ans:
            ans = fir + sec 
            ind = j 
    print ind + 1 
    #valid[j] = 1 

