Production of deuterons in the interaction of fast nucleons with nuclei