N, M = map(int, raw_input().split())
a = []
b = []
for i in range(N):
    _a, _b = map(int, raw_input().split())
    a.append(_a)
    b.append(_b)
c = []
d = []
for i in range(M):
    _c, _d = map(int, raw_input().split())
    c.append(_c)
    d.append(_d)

dist = [[float("inf")] * M for i in range(N)]
for i in range(N):
    for j in range(M):
        dist[i][j] = abs(a[i] - c[j]) + abs(b[i] - d[j])
for i in range(N):
    print dist[i].index(min(dist[i])) + 1

