import math

N, M = map(int, raw_input().split())

ab = [map(int, raw_input().split()) for _ in xrange(N)]
cd = [map(int, raw_input().split()) for _ in xrange(M)]

for i in xrange(N):
    for j in xrange(M):

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

        if j == 0:
            t = d
            ans = 1

        elif t > d:
            t = d
            ans = j+1

    print ans