An explicit algebraic structure for compact surfaces