Denote by $A_4$ the alternating group on $4$ letters, and by $\pi: A_4 \rightarrow \mathbb Z/3$ a quotient. What is the best/easiest/proper way to construct the amalgamated product $$ \{ (x,y) \in A_4 \times A_4: \pi(x) = \pi(y) \} \qquad ? $$ in the computer algebra system MAGMA as well as GAP? I did look over the respectively manual and did not see an explicit reference.
Many thanks for your help!
EDIT: My question is really about using magma and gap to construct amalgamated products; the explicit example about is meant to be a concrete illustration for what I have in mind.