The Birkhoff theorem in multidimensional gravity