n,m = list(map(int, input().split()))

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

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



for i in range(n):

  s = 0

  t = float('inf')

  for j in range(m):

    p = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])

    if p < t:

      s = j+1

      t = p

  print(s) 
n,m = list(map(int, input().split()))

ab = []

for _ in range(n):

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

  ab.append((a,b))

cd = []

for _ in range(m):

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

  cd.append((c,d))

  

for i in ab:

  s = float("inf")

  for j in range(m):

    t = abs(i[0]-cd[j][0]) + abs(i[1]-cd[j][1])

    if t < s:

      s = t

      ans = j+1

  print(ans)
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]
for i in range(n):
    s = 0
    t = float("inf")
    for j in range(m):
        p = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])
        if p < t:
            s = j + 1
            t = p
    print(s)

n, m = list(map(int, input().split()))
ab = []
for _ in range(n):
    a, b = list(map(int, input().split()))
    ab.append((a, b))
cd = []
for _ in range(m):
    c, d = list(map(int, input().split()))
    cd.append((c, d))
for i in ab:
    s = float("inf")
    for j in range(m):
        t = abs(i[0] - cd[j][0]) + abs(i[1] - cd[j][1])
        if t < s:
            s = t
            ans = j + 1
    print(ans)

-ab = [list(map(int, input().split())) for _ in range(n)] -cd = [list(map(int, input().split())) for _ in range(m)] -for i in range(n): -    s = 0 -    t = float("inf") +ab = [] +for _ in range(n): +    a, b = list(map(int, input().split())) +    ab.append((a, b)) +cd = [] +for _ in range(m): +    c, d = list(map(int, input().split())) +    cd.append((c, d)) +for i in ab: +    s = float("inf") -        p = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]) -        if p < t: -            s = j + 1 -            t = p -    print(s) +        t = abs(i[0] - cd[j][0]) + abs(i[1] - cd[j][1]) +        if t < s: +            s = t +            ans = j + 1 +    print(ans)