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

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

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



result = []

for s in S:

  a = s[0]

  b = s[1]

  for p in P:

    c = p[0]

    d = p[1]

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

    result.append(direct)

  point = min(result)

  print((result.index(point) + 1))

  result = []
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)]



result = []

for a, b in AB:

  tmp = []

  for c, d in CD:

    tmp.append(abs(a-c) + abs(b-d))

  result.append(tmp.index(min(tmp))+1)

for r in result:

  print(r)
N, M = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(N)]
P = [list(map(int, input().split())) for _ in range(M)]
result = []
for s in S:
    a = s[0]
    b = s[1]
    for p in P:
        c = p[0]
        d = p[1]
        direct = abs(a - c) + abs(b - d)
        result.append(direct)
    point = min(result)
    print((result.index(point) + 1))
    result = []

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)]
result = []
for a, b in AB:
    tmp = []
    for c, d in CD:
        tmp.append(abs(a - c) + abs(b - d))
    result.append(tmp.index(min(tmp)) + 1)
for r in result:
    print(r)

-S = [list(map(int, input().split())) for _ in range(N)] -P = [list(map(int, input().split())) for _ in range(M)] +AB = [list(map(int, input().split())) for _ in range(N)] +CD = [list(map(int, input().split())) for _ in range(M)] -for s in S: -    a = s[0] -    b = s[1] -    for p in P: -        c = p[0] -        d = p[1] -        direct = abs(a - c) + abs(b - d) -        result.append(direct) -    point = min(result) -    print((result.index(point) + 1)) -    result = [] +for a, b in AB: +    tmp = [] +    for c, d in CD: +        tmp.append(abs(a - c) + abs(b - d)) +    result.append(tmp.index(min(tmp)) + 1) +for r in result: +    print(r)