The classification of the simple modular Lie algebras: III. Solution of the classical case