# 2020/04/26
# AtCoder Beginner Contest 057 - B

# Input
n, m = map(int,input().split())

stds = list()
chkp = list()

for i in range(n):
    ab = list(map(int,input().split()))
    stds.append(ab)

for i in range(m):
    cd = list(map(int,input().split()))
    chkp.append(cd)

# Calc
for i in range(n):
    mindist = 10*9
    ans = -1
    for j in range(m):
        dist = abs(chkp[j][0] - stds[i][0]) + abs(chkp[j][1] - stds[i][1])
        if dist < mindist:
            mindist = dist
            ans = j + 1

    # Output
    print(ans)
