A theoretical consideration of the kinetics and statistics of reactions of functional groups of macromolecules