N, M = map(int, input().split())

a_arr = []
b_arr = []
for _ in range(N):
    a, b = map(int, input().split())
    a_arr.append(a)
    b_arr.append(b)
    
c_arr = []
d_arr = []
for _ in range(M):
    c, d = map(int, input().split())
    c_arr.append(c)
    d_arr.append(d)

for n in range(N):
    ans = 0
    min_dis = 10**8 + 1
    for m in range(M):
        dis = abs(a_arr[n] - c_arr[m]) + abs(b_arr[n] - d_arr[m])
        if dis < min_dis:
            min_dis = dis
            ans = m + 1
    print(ans)