mport numpy as np
N,M = map(int,raw_input().split())
a = []
c = []
for i in range(N):
    a.append(map(int,raw_input().split()))
#print a
for j in range(M):
    c.append(map(int,raw_input().split()))
a = np.array(a)
c = np.array(c)
#print a.shape
#print c.shape
min = 100
index = np.zeros(N)
for i in range(N):
    for j in range(M):
        if min > np.abs(a[i][0]-c[j][0])+np.abs(a[i][1]-c[j][1]):
            min = np.abs(a[i][0]-c[j][0])+np.abs(a[i][1]-c[j][1])
            index[i] = j
        if min == np.abs(a[i][0]-c[j][0])+np.abs(a[i][1]-c[j][1]):
            if j < index[i]:
                index[i] = j
index = index.astype(np.int32)
for i in range(N):
    print index[i]+1