Exercise about product of graphs in "Conceptual Mathematics" Please tell me how to solve the following exercise which is in the book "Conceptual Mathematics A first introduction to categories Second Edition".

How can I show that for any object X of category of graphs the diagram is commutative from the fact that following two diagrams are commutative?

 A: The first observation to make is that given $B_1\overset{a_1}{\leftarrow} C\overset{a_2}{\rightarrow} B_2$, a morphism $A\to C$ (resp. $D\to C$) gives rise to a pair of morphisms $B_1\leftarrow A\rightarrow B_2$ (resp. $B_1\leftarrow D\rightarrow B_2$) by composition with the $a_i$. And by hypothesis, such pairs correspond to morphisms $A\to P$ (resp. $D\to P$). If there are morphisms $f,g:C\to P$ with $$\pi_1\circ f=\pi_1\circ g=a_1$$ and $$\pi_2\circ f=\pi_2\circ g=a_2,$$ then for any $x:A\to C$ it's easy to check that $f\circ x=g\circ x$ by $P$ being a "product with respect to $A$ and $D$", and similarly for any morphism $D\to C$; but then $f=g$ by the (italicized in the text) property of morphisms from $A$ or $D$. So if there is a morphism $f:C\to P$ making $\pi_i\circ f=a_i$, it is unique.
How do we prove the existence of such a unique $f$? I don't believe the authors have mentioned the really nice thing yet about this category of graphs, where every object is actually a colimit of a diagram consisting of $A$s and $D$s; from this, existence is almost immediate. But you can figure it out element-wise by taking an edge $e$ of $C$ to $\langle a_1\circ \tilde{e},a_2\circ \tilde{e}\rangle(e_0)$, where $\tilde{e}$ is the morphism $A\to C$ that picks out the edge $e$, $e_0$ is the unique edge of $A$, and $\langle a_1\circ \tilde{e},a_2\circ \tilde{e}\rangle$ is the unique morphism $A\to P$ corresponding to the pair of morphisms $a_i\circ\tilde{e}:A\to B_i$ (and you do the essentially thing for the graph's vertices and morphisms $D\to C$). 
All that's needed is to confirm that this assignment really is a morphism of graphs, which is boring but not too hard. It should be clear that the process I've just described gives us a function from the edges of $C$ to the edges of $P$, and likewise for the vertices. All that's needed to check that it's a morphism of graphs is to check that $$s_P(\langle a_1\circ\tilde{e},a_2\circ\tilde{e}\rangle(e_0))=\langle a_1\circ\widetilde{s_C(e)},a_2\circ\widetilde{s_C(e)}\rangle(d_0)$$ and likewise  $$t_P(\langle a_1\circ\tilde{e},a_2\circ\tilde{e}\rangle(e_0))=\langle a_1\circ\widetilde{t_C(e)},a_2\circ\widetilde{t_C(e)}\rangle(d_0),$$ where $d_0$ and $s_\ldots$ and $t_\ldots$ are the source and target operations on the subscripted graphs. What will make this easier to check is that if $d=s_C(e)$, then, where $x_1,x_2:D\to A$ are the morphisms picking out the source and target vertices respectively in $A$, then $$\widetilde{s_C(e)}=\tilde{d}=\tilde{e}\circ x_1$$ and $$\widetilde{t_C(e)}=\tilde{e}\circ x_2.$$ Moreover $$s_P(\langle a_1\circ\tilde{e},a_2\circ\tilde{e}\rangle(e_0))=\langle a_1\circ\tilde{e},a_2\circ\tilde{e}\rangle\circ x_1(d_0),$$ and similarly with $t$ and $x_2$. With these equalities it should be easy to check.
