The long-necked giraffes had more and more babies that, like their parents, inherited long necks and were better able to survive when food was scarce;
(The long-necked giraffes; had; more and more babies that, like their parents, inherited long necks and were better able to survive) (more and more babies; inherited; long necks) (more and more babies; were; better able to survive) (food; was; scarce)
The long-necked giraffes more and more babies more and more babies food
had inherited were was
more and more babies that, like their parents, inherited long necks and were better able to survive
long necks
better able to survive
scarce