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

ab = []

for _ in range(n):

    a, b = (int(x) for x in input().split())

    ab.append([a, b])

cd = []

for _ in range(m):

    c, d = (int(x) for x in input().split())

    cd.append([c, d])



for a,b in ab:

    ans = 10000000000000000000000

    for k,c in enumerate(cd):

        memo = abs(a-c[0])+abs(b-c[1])

        if memo<ans:

            ans=memo

            ansnum=k

    print((ansnum+1))
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 a,b in AB:

    tmp_point = -1

    tmp_root = 100000000000

    for i,cd in enumerate(CD):

        c,d = cd

        if abs(a-c)+abs(b-d) < tmp_root:

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

            tmp_point = i+1

    print(tmp_point)
n, m = list(map(int, input().split()))
ab = []
for _ in range(n):
    a, b = (int(x) for x in input().split())
    ab.append([a, b])
cd = []
for _ in range(m):
    c, d = (int(x) for x in input().split())
    cd.append([c, d])
for a, b in ab:
    ans = 10000000000000000000000
    for k, c in enumerate(cd):
        memo = abs(a - c[0]) + abs(b - c[1])
        if memo < ans:
            ans = memo
            ansnum = k
    print((ansnum + 1))

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 a, b in AB:
    tmp_point = -1
    tmp_root = 100000000000
    for i, cd in enumerate(CD):
        c, d = cd
        if abs(a - c) + abs(b - d) < tmp_root:
            tmp_root = abs(a - c) + abs(b - d)
            tmp_point = i + 1
    print(tmp_point)

-n, m = list(map(int, input().split())) -ab = [] -for _ in range(n): -    a, b = (int(x) for x in input().split()) -    ab.append([a, b]) -cd = [] -for _ in range(m): -    c, d = (int(x) for x in input().split()) -    cd.append([c, d]) -for a, b in ab: -    ans = 10000000000000000000000 -    for k, c in enumerate(cd): -        memo = abs(a - c[0]) + abs(b - c[1]) -        if memo < ans: -            ans = memo -            ansnum = k -    print((ansnum + 1)) +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 a, b in AB: +    tmp_point = -1 +    tmp_root = 100000000000 +    for i, cd in enumerate(CD): +        c, d = cd +        if abs(a - c) + abs(b - d) < tmp_root: +            tmp_root = abs(a - c) + abs(b - d) +            tmp_point = i + 1 +    print(tmp_point)