  We describe all pseudo-Riemannian metrics on closed surfaces whose geodesic
flows admit nontrivial integrals quadratic in momenta. As an application, we
solve the Beltrami problem on closed surfaces and prove the nonexistence of
quadratically-superintegrable metrics of nonconstant curvature on closed
surfaces
