class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y
def diff(p1, p2):
    return abs(p1.x - p2.x) + abs(p1.y - p2.y)
N, M = map(int, raw_input().split())
S = []
for i in xrange(N):
    x, y = map(int, raw_input().split())
    s = Point(x, y)
    S.append(s)
C = []
for i in xrange(M):
    x, y = map(int, raw_input().split())
    c = Point(x, y)
    C.append(c)
for s in S:
    index = None
    dist = 1e9
    for i, c in enumerate(C):
        d = diff(s, c) 
        if d < dist:
            dist = d
            index = i
    print index + 1