Diagram for solution.