#!/usr/bin/python

import sys

def main(argv):
    line = sys.stdin.readline().rstrip("\n")

    while line:
        n, m = map(lambda x: int(x), line.split(" ", 2))

        students = []
        points = []
        for i in xrange(n):
            x, y = map(lambda x: int(x), raw_input().split(" ", 2))
            students.append((x, y))

        for i in xrange(m):
            x, y = map(lambda x: int(x), raw_input().split(" ", 2))
            points.append((x, y))

        for sx, sy in students:
            min_index = -1
            min_distance = 4 * 100000000

            for (i, (px, py)) in enumerate(points):
                distance = abs(sx - px) + abs(sy - py)
                if distance < min_distance:
                    min_distance = distance
                    min_index = i + 1
            print min_index

        line = sys.stdin.readline().rstrip("\n")

if __name__ == "__main__":
    main(sys.argv)