A horizontal well in a composite system with planar interfaces