#!/usr/bin/env python3

import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')

inf = float('inf')

ans = 0 ;count = 0 ;pro = 1



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

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

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

for a,b in ab:

    tmp=inf

    candi=0

    for j in range(m):

        c=cd[j][0]

        d=cd[j][1]

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

        if tmp>k:

            tmp=k

            candi=j

    print((candi+1))





#!/usr/bin/env python3

import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')

inf = float('inf') ;mod = 10**9+7

mans = inf ;ans = 0 ;count = 0 ;pro = 1



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

CD = [tuple(map(int,input().split())) for i in range(n)]

AB = [tuple(map(int,input().split())) for i in range(m)]

for c,d in CD:

  print((min(list(range(m)),key = lambda x:abs(AB[x][0]-c) + abs(AB[x][1]-d))+1))



#!/usr/bin/env python3
import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8")
inf = float("inf")
ans = 0
count = 0
pro = 1
n, m = list(map(int, input().split()))
ab = [tuple(map(int, input().split())) for i in range(n)]
cd = [tuple(map(int, input().split())) for i in range(m)]
for a, b in ab:
    tmp = inf
    candi = 0
    for j in range(m):
        c = cd[j][0]
        d = cd[j][1]
        k = abs(a - c) + abs(b - d)
        if tmp > k:
            tmp = k
            candi = j
    print((candi + 1))

#!/usr/bin/env python3
import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode("utf-8")
inf = float("inf")
mod = 10**9 + 7
mans = inf
ans = 0
count = 0
pro = 1
n, m = list(map(int, input().split()))
CD = [tuple(map(int, input().split())) for i in range(n)]
AB = [tuple(map(int, input().split())) for i in range(m)]
for c, d in CD:
    print(
        (min(list(range(m)), key=lambda x: abs(AB[x][0] - c) + abs(AB[x][1] - d)) + 1)
    )

+mod = 10**9 + 7 +mans = inf -ab = [tuple(map(int, input().split())) for i in range(n)] -cd = [tuple(map(int, input().split())) for i in range(m)] -for a, b in ab: -    tmp = inf -    candi = 0 -    for j in range(m): -        c = cd[j][0] -        d = cd[j][1] -        k = abs(a - c) + abs(b - d) -        if tmp > k: -            tmp = k -            candi = j -    print((candi + 1)) +CD = [tuple(map(int, input().split())) for i in range(n)] +AB = [tuple(map(int, input().split())) for i in range(m)] +for c, d in CD: +    print( +        (min(list(range(m)), key=lambda x: abs(AB[x][0] - c) + abs(AB[x][1] - d)) + 1) +    )