def dist(x,y):

    return abs(x[0]-y[0])+abs(x[1]-y[1])

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

X = [list(map(int,input().split())) for _ in range(N)]

Y = [list(map(int,input().split())) for _ in range(M)]

for i in range(N):

    dmin = 10**9

    for j in range(M-1,-1,-1):

        d = dist(X[i],Y[j])

        if d<=dmin:

            dmin = d

            ind = j+1

    print(ind)
def dist(x,y):

    return abs(x[0]-y[0])+abs(x[1]-y[1])

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

X = [list(map(int,input().split())) for _ in range(N)]

Y = [list(map(int,input().split())) for _ in range(M)]

for i in range(N):

    x,y = X[i]

    ind = M+1

    dmin = 10**9

    for j in range(M):

        c,d = Y[j]

        d = dist((x,y),(c,d))

        if d<dmin:

            ind = j+1

            dmin = d

    print(ind)
def dist(x, y):
    return abs(x[0] - y[0]) + abs(x[1] - y[1])


N, M = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
Y = [list(map(int, input().split())) for _ in range(M)]
for i in range(N):
    dmin = 10**9
    for j in range(M - 1, -1, -1):
        d = dist(X[i], Y[j])
        if d <= dmin:
            dmin = d
            ind = j + 1
    print(ind)

def dist(x, y):
    return abs(x[0] - y[0]) + abs(x[1] - y[1])


N, M = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]
Y = [list(map(int, input().split())) for _ in range(M)]
for i in range(N):
    x, y = X[i]
    ind = M + 1
    dmin = 10**9
    for j in range(M):
        c, d = Y[j]
        d = dist((x, y), (c, d))
        if d < dmin:
            ind = j + 1
            dmin = d
    print(ind)

+    x, y = X[i] +    ind = M + 1 -    for j in range(M - 1, -1, -1): -        d = dist(X[i], Y[j]) -        if d <= dmin: +    for j in range(M): +        c, d = Y[j] +        d = dist((x, y), (c, d)) +        if d < dmin: +            ind = j + 1 -            ind = j + 1