def main():
    n, m = map(int, input().split())
    students = [tuple(map(int, input().split())) for i in range(n)]
    check_points = [tuple(map(int, input().split())) for i in range(m)]

    for a, b in students:
        dist = [abs(a - c) + abs(b - d) for c, d in check_points]
        print(check_points.index(min(dist) + 1))
        
    # for st in students:
    #     min_pt = check_points[0]
    #     for pt in check_points:
    #         if abs(pt[0] - st[0]) + abs(pt[1] - st[1]) < \
    #            abs(min_pt[0] - st[0]) + abs(min_pt[1] - st[1]):
    #             min_pt = pt
    #     print(check_points.index(min_pt) + 1)


if __name__ == "__main__":

    main()
