By the fundamental theorem of finitely generated abelian groups there exists an integer $n\geq 0 $ and integers $q_1,\ldots,q_k$ such that
$$A\cong \mathbb{Z}^n\times \mathbb{Z}_{q_1}\times\cdots\times \mathbb{Z}_{q_k}.$$
Now recall that if $(X,x_0,Y,y_0)$ are based topological spaces then
$$\pi_1(X\times Y,(x_0,y_0))\cong\pi_1(X,x_0)\times \pi_1(Y,y_0).$$
Now $\pi_1(\mathbb{S}^1,z_0)\cong \mathbb{Z}$ for any $z_0\in\mathbb{S}^1,$ so if $T^n$ is the $n$-torus $\mathbb{S}^1\times \cdots\times\mathbb{S}^1$ ($n$-times), then $$ \pi_1(T^n,t_0)\cong \mathbb{Z}^n$$
for any $t_0\in T^n.$
Now consider the space $X=\mathbb{D}^2/\sim$ where
$$ (\cos\theta, \sin \theta)\sim (\cos(\theta+\frac{2\pi}{n}),\sin(\theta+\frac{2\pi}{n}))$$
for all $\theta\in [0,2\pi].$ Using Seifert-van Kampen one can show that $\pi_1(X,\overline{x_0})\cong\mathbb{Z}_n$ for any $\overline{x_0}\in X.$
With this in mind define, for $i=1,\ldots,k,$ the space $X_i:=\mathbb{D}^2/\sim$ where
$$ (\cos\theta, \sin \theta)\sim (\cos(\theta+\frac{2\pi}{q_i}),\sin(\theta+\frac{2\pi}{q_i}))$$
for all $\theta\in [0,2\pi],$ so that $\pi_1(X_i,\overline{x_i})\cong\mathbb{Z}_{q_i}$ for each $i=1,\ldots,k$ and every $\overline{x_i}\in X_i.$
Therefore, defining
$$Y:=T^n\times X_1\times X_2\times\cdots\times X_k,$$ we have
$$ \pi_1(Y,(t_0,\overline{x_1},\ldots,\overline{x_k}))\cong \mathbb{Z}^n\times \mathbb{Z}_{q_1}\times\cdots\times \mathbb{Z}_{q_k}\cong A$$
for all $(t_0,\overline{x_1},\ldots,\overline{x_k})\in Y$