def create_list(n):
    result = [[i for i in map(int,input().split())] for j in range(n)]
    return result 

n,m = map(int,input().split())
x_list   = create_list(n)
y_list   = create_list(m)
ans_list = []

for x in x_list:
    ans   = 0
    min_n = 51
    for i,y in enumerate(y_list):
        temp = abs(x[0]-y[0]) + abs(x[1]-y[1])
        if temp < min_n:
            min_n = temp
            ans = i+1
    ans_list.append(ans)

for num in ans_list:
    print(num)