def main():
    #infile = open("compprog.txt", mode="r")
    n, m = [int(x) for x in input().split()]
    students = []
    cpoints = []
    for _ in range(n):
        students.append([int(x) for x in input().split()])
    for _ in range(m):
        cpoints.append([int(x) for x in input().split()])
    for stu in students:
        res = 1
        closest_dis = man_dis(stu[0], cpoints[0][0], stu[1], cpoints[0][1])
        for c_idx in range(1, m):
            if man_dis(stu[0], cpoints[c_idx][0], stu[1], cpoints[c_idx][1]) < closest_dis:
                res = c_idx + 1
        print(res)
    #infile.close()


def man_dis(a, b, c, d):
    return abs(a - b) + abs(c - d)


if __name__ == "__main__":
    main()
