On the theory of formation of a twin (ferroelastic) structure in high-temperature superconductors with oxygen nonstoichiometry