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

la = []
for i in range(n):
    a, b = map(int, input().split())
    la.append([a,b])

ca = []
for i in range(n):
    a, b = map(int, input().split())
    ca.append([a,b])

for i in la:
    mi = 1000000001
    ans = 0
    for k,j in enumerate(ca):
        if abs(i[0]-j[0]) + abs(i[1]-j[1]) < mi:
            mi = abs(i[0]-j[0]) + abs(i[1]-j[1])
            ans = k+1
    print(ans)

