import numpy as np

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

human=[]

for i in range(N):

  a,b=list(map(int, input().split()))

  human.append((a,b))

C=[]

for i in range(M):

  c,d=list(map(int, input().split()))

  C.append((c,d))

  

for h in human:

  a,b=h

  now=0

  mini=np.inf

  for i,ch in enumerate(C):

    c,d=ch

    L=abs(a-c)+abs(b-d)

    if mini>L:

      mini=L

      now=i+1

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

S=[]

for i in range(N):

    a,b=list(map(int, input().split()))

    S.append((a,b))



C=[]

for i in range(M):

    c,d=list(map(int, input().split()))

    C.append((c,d,i+1))

#print(C)

for s in S:

    a,b=s

    now=0

    dis=10**9



    for t in C:

        c,d,n=t

        D=abs(c-a)+abs(d-b)

        

        if D<dis:

            dis=D

            now=n

    print(now)
import numpy as np

N, M = list(map(int, input().split()))
human = []
for i in range(N):
    a, b = list(map(int, input().split()))
    human.append((a, b))
C = []
for i in range(M):
    c, d = list(map(int, input().split()))
    C.append((c, d))
for h in human:
    a, b = h
    now = 0
    mini = np.inf
    for i, ch in enumerate(C):
        c, d = ch
        L = abs(a - c) + abs(b - d)
        if mini > L:
            mini = L
            now = i + 1
    print(now)

N, M = list(map(int, input().split()))
S = []
for i in range(N):
    a, b = list(map(int, input().split()))
    S.append((a, b))
C = []
for i in range(M):
    c, d = list(map(int, input().split()))
    C.append((c, d, i + 1))
# print(C)
for s in S:
    a, b = s
    now = 0
    dis = 10**9
    for t in C:
        c, d, n = t
        D = abs(c - a) + abs(d - b)
        if D < dis:
            dis = D
            now = n
    print(now)

-import numpy as np - -human = [] +S = [] -    human.append((a, b)) +    S.append((a, b)) -    C.append((c, d)) -for h in human: -    a, b = h +    C.append((c, d, i + 1)) +# print(C) +for s in S: +    a, b = s -    mini = np.inf -    for i, ch in enumerate(C): -        c, d = ch -        L = abs(a - c) + abs(b - d) -        if mini > L: -            mini = L -            now = i + 1 +    dis = 10**9 +    for t in C: +        c, d, n = t +        D = abs(c - a) + abs(d - b) +        if D < dis: +            dis = D +            now = n