  We consider the symplectic groupoid of pairs $(B,\mathbb{A})$ with $\mathbb
A$ unipotent upper-triangular matrices and $B\in GL_n$ being such that
$\widetilde {\mathbb A}=B{\mathbb A} B^{\text{T}}$ are also unipotent
upper-triangular matrices. We explicitly solve this groupoid condition using
Fock--Goncharov--Shen cluster variables and show that for $B$ satisfying the
standard semiclassical Lie--Poisson algebra, the matrices $B$, $\mathbb A$, and
$\widetilde{\mathbb A}$ satisfy the closed Poisson algebra relations
expressible in the $r$-matrix form. Identifying entries of $\mathbb A$ and
$\widetilde {\mathbb A}$ with geodesic functions for geodesics on the two
halves of a closed Riemann surface of genus $g=n-1$ separated by the Markov
element, we are able to construct the geodesic function $G_B$ ``dual'' to the
Markov element. We thus obtain the complete cluster algebra description of
Teichm\"uller space $\mathcal T_{2,0}$ of genus two. We discuss also the
generalization of our construction for higher genera. For genus larger than
three we need a Hamiltonian reduction based on the rank condition
$\hbox{rank\,}({\mathbb A}+{\mathbb A}^{\text{T}})\le 4$; we present the
example of such a reduction for $\mathcal T_{4,0}$.
