The Ernst equation is formulated on an arbitrary Riemann surface.
Analytically, the problem reduces to finding solutions of the ordinary Ernst
equation which are periodic along the symmetry axis. The family of (punctured)
Riemann surfaces admitting a non-trivial Ernst field constitutes a ``partially
discretized'' subspace of the usual moduli space. The method allows us to
construct new exact solutions of Einstein's equations in vacuo with non-trivial
topology, such that different ``universes'', each of which may have several
black holes on its symmetry axis, are connected through necks bounded by cosmic
strings. We show how the extra topological degrees of freedom may lead to an
extension of the Geroch group and discuss possible applications to string
theory.Comment: 22 page