Suppose we have a surface $\Sigma$ which is represented by a $2n$-gon $P$ whose edges are identified using some scheme $(e_1e_2\dots e_{2n})$ where each $e_i$ is an element of the set $A = \{a_1, \dots, a_n\}$ with either no decoration or an $\cdot ^{-1}$, and each element of $A$ appears exactly twice. Then we can use this scheme to give a presentation for $\pi_1(\Sigma)$, under the assumption that there is a unique vertex class, that is once all the edges have been identified there is only one vertex. (The schemes that you wrote down all have this property, but something like $(\dots aa^{-1}\dots)$ does not.)
Choose an $x$ in the interior of $P$, and consider the open sets $U_1 = \Sigma\setminus \{x\}$ and $U_2 = int(P)$, whose intersection is homotopy equivalent to $S^1$ which is path-connected. Then clearly $U_2$ is contractible, but how do we describe $U_1$? $U_1$ deformation retracts onto the boundary of $P$, so it is homotopy equivalent to the identified edges. Since there is a unique vertex class, the identified edges make up a wedge of $n$-circles, one for each element of $A$. Then the Seifert-van Kampen theorem says that $\pi_1(\Sigma)$ is an amalgamated product
$$ \pi_1(U_1) *_{\pi_1(U_1\cap U_2)} \pi_1(U_2) \cong \pi_1(\vee^n S^1)*_{\pi_1(S^1)}1 $$
To finish the computation it remains to describe the homomorphism $\pi_1(U_1\cap U_2) \to \pi_1(U_1)$. A generator of $\pi_1(U_1\cap U_2)$ is a loop in the interior of $P$ that encircles $x$ once, and this loop is homotopic in $U_1$ to the loop that traverses the boundary, i.e. the loop $(e_1\dots e_{2n})$. Unravelling the definition of the amalgamated product, it follows that $\pi_1(\Sigma)$ is a group with $n$ generators and one relation given by the scheme itself, i.e.
$$ \pi_1(\Sigma) \cong \langle a_1,\dots,a_n\ |\ e_1\dots e_{2n} = 1 \rangle. $$
To illustrate lets consider the examples $\mathbb{R}P^2$, $T^2$, $K$, and $T^2 \# T^2$. The scheme for $\mathbb{R}P^2$ is $(aa)$, so when we do the Seifert-van Kampen argument with its polygon we get
$$\pi_1(\mathbb{R}P^2) \cong \langle a\ |\ a^2 = 1 \rangle \cong \mathbb{Z}/2 .$$
The scheme for the $2$-torus $T^2$ is $(aba^{-1}b^{-1})$ so
$$\pi_1(T^2) \cong \langle a, b\ |\ ab = ba \rangle \cong \mathbb{Z} \oplus \mathbb{Z}.$$
On the other hand the scheme for $K$ is $(aba^{-1}b)$ so the van Kampen argument gives us
$$\pi_1(K) \cong \langle a, b\ |\ aba^{-1} = b^{-1}\rangle $$
so in this particular case it can actually be described as a semi-direct product $\mathbb{Z} \rtimes \mathbb{Z}$.
The scheme for $T^2 \#T^2$ is $aba^{-1}b^{-1}cdc^{-1}d^{-1}$ so the argument computes
$$ \pi_1(T^2 \# T^2) \cong \langle a, b, c, d\ |\ aba^{-1}b^{-1}cdc^{-1}d^{-1} = 1 \rangle.$$
This presentation can't really be simplified any more, and unlike the above examples where we have really clean expressions for group this is basically the best we can do in this case. If you did a Seifert-van Kampen argument by decomposing $T^2 \# T^2$ into two copies of $T^2 \setminus\{pt\}$ then you will get the same presentation.
Now, the surface $\mathbb{R}P^2\# K$ has the scheme $(aba^{-1}bcc)$, which has one vertex class. Can you see how to use Seifert-van Kampen to compute its fundamental group in terms of this scheme?
but what is 1(2#K)
– Sam Sam Dec 19 '19 at 12:58