import math

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

a, b, c, d = [], [], [], []

for i in xrange(N):
    s = map(int, raw_input().split())
    a.append(s[0])
    b.append(s[1])

for i in xrange(M):
    s = map(int, raw_input().split())
    c.append(s[0])
    d.append(s[1])


ans = 0
t = 0
for i in xrange(N):
    for j in xrange(M):
        if j == 0:
            t = abs(a[i]-c[j]) + abs(b[i]-d[j])
            ans = 1
        elif t > abs(a[i]-c[j]) + abs(b[i]-d[j]):
            t = abs(a[i]-c[j]) + abs(b[i]-d[j])
            ans = j+1
        #print "t = %d" % t
        #print "ans=%d" % ans
    print ans