Extrema of the density functional for the energy: Excited states from the ground-state theory.