n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
c = [list(map(int, input().split())) for i in range(m)]
for i in range(n):
    dim, num = 10*10, -1
    for j in range(m):
        if abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1]) < dim:
            dim = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1])
            num = j
    print(num+1)