We consider a Fuchsian group Г and the factor surface H/Г, which has constant curvature $-1$ and maybe a few singularities. If we lift the surface continuously to $\H$ (except for a subset of a lower dimension), we obtain a fundamental domain $\D$ of Г. This can be done in different ways; ours is to restrict the choice to so-called Dirichlet domains, which always are convex polygonal subsets of $\H$. Given a generic geodesic on $\H$, one can produce a so-called geometric Morse code (or the cutting sequence) of the geodesic with respect to $\D$. We prove that the set of Morse codes of all generic geodesics on $\H$ with respect to $\D$ forms a topological Markov chain if and only if $\D$ is an ideal polygon.