This is only a partial answer. Let $E$ be the space $S^1\times A\times A$ and let $f\colon E\rightarrow B$ be the quotient map $(x_1,x_2,x_3)\mapsto [(x_1,x_2,x_3)]$. Note that $\pi_1(E,(1,a_1,a_1))\cong\mathbb{Z}\times\pi_1(A,a_1)\times\pi_1(A,a_1)$
Let $g\colon E\rightarrow E$ be given by $g(x_1,x_2,x_3)=(-x_1,x_3,x_2)$.
The map $f$ is a double covering of $E$ on to $B$ with deck transformation group given by the free group action of $\mathbb{Z}_2$ on $E$ generated by the map $g$ (free because $g$ has no fixed points). Note that $\mathbb{Z}_2$ acts transitively on fibers and so the covering is a normal covering map. We therefor have an induced short exact sequence $$0\rightarrow\pi_1(E,(1,a_1,a_1))\stackrel{f_*}{\rightarrow}\pi_1(B,f(1,a_1,a_1))\rightarrow\mathbb{Z}_2\rightarrow 0$$ given by the principle $G$-bundle.
We can then see that $$\frac{\pi_1(B,f(1,a_1,a_1))}{\mathbb{Z}\times\pi_1(A,a_1)\times\pi_1(A,a_1)}\cong\mathbb{Z}_2$$ where the subgroup we're modding out by is really the image of the fundamental group of $E$ under the induced homomorphism $f_*$. As to how this subgroup is embedded in to $\pi_1(B,f(1,a_1,a_1))$, this will probably require some argument involving the generators of $\pi_1(S^1,1)$ and $\pi_1(A,a_1)$.