Graded Lie algebras of maximal class. IV