Sequence of phase transformations in the formation of superstructures of the M6C5 type in nonstoichiometric carbides