I am studying for the qualifying exams I am taking last week and am struggling with the following problem:
Here's what I've tried. Say we call the left side $X$ and the right side $X'$. Pick $U=X\times[0,.6)$ and $V=X'\times(.4,1]$ (so $U$ and $V$ are $X,X'$, respectively, along with some of the prism that intersect. Then we may use SVK. We have $\pi_1(U)=\langle a,b,c,d\mid adc^{-1}d^{-1}c^{-1}b^{-1}a^{-1}b\rangle$ and similarly for $\pi_1(V)$. So $\pi_1(Y)\cong\pi_1(X)*\pi_1(V)/N$ where $N$ is the least normal subgroup containing elements of the form $i_1(g)^{-1},i_2(g)^{-1}$ where $i_1,i_2$ are the inclusion maps from $U\cap V$ to $U,V$. This is where I am stuck.
Any help would be greatly appreciated. I am wondering if there is some totally different way to approach this or see $Y$ that would help.
Thank you!

Note that $Y$ denotes the boundary of the octogonal prism, along with the identifications. So $U$ would be $X \cup (\partial X \times [0,0.6))$ modulo identifications, and similarly for $V$. With this setup $U \cap V \simeq S^1$. As you say, $U$ and $V$ deformation retract to $X$ and $X'$ modulo identifications, and we have $\pi_1(U) = \langle a,b,c,d \mid adc^{-1}d^{-1}c^{-1}b^{-1}a^{-1}b \rangle$ and $\pi_1(V) = \langle e,f,g,h \mid ehg^{-1}h^{-1}g^{-1}f^{-1}e^{-1}f \rangle$. Also, the generator $1 \in \pi_1(U \cap V)$ gets mapped to $adc^{-1}d^{-1}c^{-1}b^{-1}a^{-1}b$ inside $\pi_1(U)$ and to $ehg^{-1}h^{-1}g^{-1}f^{-1}e^{-1}f$ inside $\pi_1(V)$. In other words, the homomorphisms $\pi_1(U \cap V) \to \pi_1(U)$ and $\pi_1(U \cap V) \to \pi_1(V)$ are trivial. So by SVK we should have that $$\pi_1(Y) \cong \pi_1(U) * \pi_1(V) = \langle a,b,c,d,e,f,g,h \mid adc^{-1}d^{-1}c^{-1}b^{-1}a^{-1}b, ehg^{-1}h^{-1}g^{-1}f^{-1}e^{-1}f \rangle.$$