  We study pairs of matrices $A,B\in GL_n({\mathbb C})$ such that the
eigenvalues of $A$, of $B$ and of the product $AB$ are specified in advance. We
show that the space of such pairs $(A,B)$ under simultaneous conjugation has
dimension $(n-1)(n-2)$, and give an explicit parameterization.
  More generally let $\Sigma$ be a surface of genus $g$ with $k$ punctures. We
find a parameterization of the space $\Omega_{g,k,n}$ of flat $GL_n({\mathbb
C})$-structures on $\Sigma$ whose holonomies around the punctures have
prescribed eigenvalues.
  We show furthermore that, for $3\le k\le 2g+6$ (or $3\le k\le 9$ if $g=1$, or
$3\le k$ if $g=0$), the space $\Omega_{g,k,n}$ has an explicit symplectic
structure and an associated Liouville integrable system, equivalent to a leaf
of a Goncharov-Kenyon dimer integrable system.
