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

a, b = [map(int, raw_input().split()) for _ in xrange(N)]
c, d = [map(int, raw_input().split()) for _ in xrange(M)]

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

        d = abs(a[i]-c[j]) + abs(b[i]-d[j])

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

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

    print ans