Solution (source code)

= Solution
{c}

Every complete <polygon edge> pairing gives a <compact> <connected> <surface> with empty <manifold boundary>. Here is the local reason at the vertices. Replace each <polygon> corner by a small link <interval>. The <polygon edge> pairings identify all endpoints of these link <intervals> in pairs. In a given vertex <equivalence class>, the resulting <graph> is <connected>: the endpoint identifications generating that vertex <equivalence class> also connect its corner <intervals>. Every link <graph vertex> has <degree of a vertex> two, so the <graph> is a <circle>. Its <topological cone> is a <disc>, giving the required local <surface> model. Edge and face <CW cell> interiors have the usual <disc> <neighbourhoods> as well. A finite <triangulation> compatible with the <polygon edge> pairings realizes the result as a finite <simplicial complex>, giving a <Hausdorff>, <second-countable space>.

For every such <surface>, $\chi=V-2\geq-1$. If it is <orientable>, the <classification of compact surfaces> gives $\chi=2-2g$, so $g=0$ or $1$. If it is a <nonorientable surface>, write $k\geq1$ for its <nonorientable genus>; then $\chi=2-k\geq-1$ gives $k\leq3$. The exhaustive list is therefore

* the <sphere> $S^2$;
* the <torus> $T^2$;
* the <real projective plane> $\mathbb{RP}^2$;
* the <Klein bottle> $\mathbb{RP}^2\mathbin\#\mathbb{RP}^2$;
* the <connected sum of surfaces> $\mathbb{RP}^2\mathbin\#\mathbb{RP}^2\mathbin\#\mathbb{RP}^2$, a <nonorientable surface> of <nonorientable genus> three.

To prove that every listed possibility actually occurs, the following six-letter boundary words specify complete pairings of a <hexagon>:
$$
\begin{array}{c|c|c|c}
\text{surface}&\text{boundary word}&V&\chi=V-2\\\hline
S^2&aa^{-1}bb^{-1}cc^{-1}&4&2\\
\mathbb{RP}^2&aabb^{-1}cc^{-1}&3&1\\
T^2&abca^{-1}b^{-1}c^{-1}&2&0\\
\text{Klein bottle}&aba^{-1}bcc^{-1}&2&0\\
\mathbb{RP}^2\#\mathbb{RP}^2\#\mathbb{RP}^2&aabbcc&1&-1
\end{array}
$$
The vertex counts follow by matching starts and ends of equally directed arrows, just as in part (b). The first and third words pair every letter with its inverse, giving <orientable> <surfaces>. Each other word contains a letter twice with the same sign, giving a <nonorientable surface>: an <orientation> on the face would induce equal, rather than opposite, boundary directions along that glued pair. With the displayed <Euler characteristics>, the <classification of compact surfaces> identifies the examples exactly as listed. \b[All five types occur, and no others occur.]