I am having trouble trying to understand how this question passes from this point
$$ ( ( p\vee q )\wedge (p \vee \neg r ) \wedge (\neg q \vee \neg r ) ) \vee ( \neg p \vee r ) $$
to this $$ (p\vee q \vee \neg p \vee r)\wedge(p \vee \neg r \vee \neg p \vee r)\wedge(\neg q \vee \neg r \vee \neg p \vee r) $$
$$ T \wedge T \wedge T = T $$
I'm sure it has to do something with the distribution law ($p\vee(q \wedge r) =(p\vee q)\wedge(p \vee r)$) but I'm confused on how it is applied. Can anyone give me a heads-up on where and how I should start expanding?
The first formula is of the form $$(A\land B\land C)\lor D$$ while the second one is $$(A\lor D)\land(B\lor D)\land(C\lor D)\,.$$