# coding:utf-8

NM = raw_input().split()
N = int(NM[0])
M = int(NM[1])

a = []
b = []
c = []
d = []
for i in xrange(N):
    ab = raw_input().split()
    a.append(int(ab[0]))
    b.append(int(ab[1]))

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

for i in xrange(N):
    memo = []
    for j in xrange(M):
        memo.append(abs(a[i]-c[j])+abs(b[i]-d[j]))
    print memo.index(min(memo)) + 1
