The process by which heavier chemical elements are synthesized in the interiors of stars from hydrogen nuclei and other previously synthesized elements. Precisely which elements are involved in nucleosynthesis depends on the age and mass of the star. The most prevalent reaction in smaller stars like our Sun is the fusion of hydrogen into helium by the proton-proton chain; in more massive stars this fusion occurs via the carbon cycle. When a star is burning hydrogen in its core, it is a main-sequence star. In older stars such as the red giants, nucleosynthesis involves the burning of heavier elements created by earlier fusion; for example, helium may burn via the triple alpha process. More massive stars—over eight solar masses—also fuse carbon into neon and magnesium, oxygen into silicon and sulfur, and silicon into iron. The nucleosynthesis of iron is the precursor to the transition into the supernova phase.