def inside_box(p1, p2, p3, space=0):
    """Checks if p3 is inside a box formed by p1 and p2."""
    if p1[0] < p3[0] and p3[0] < p2[0] or p1[0] > p3[0] and p3[0] > p2[0]:
        if p1[1] < p3[1] and p3[1] < p2[1] or p1[1] > p3[1] and p3[1] > p2[1]:
            return True
        else:
            return False
