I noticed my first gray hair during my medical residency. It sneaked up on me at the end of a long, frenzied shift — one of those nights when Murphy’s Law seems stronger than the law of gravity. Two of my patients did slip and fall, though, so Newton made a strong showing too.

The next day, I found another gray. Then another and another, until I stopped counting.

I was in my mid-20s, and it was the first time I’d noticed my body aging — not getting stronger or faster or wiser, but starting its decline. The human body performs so many impressive functions, I thought: It heals wounds, clears waste, digests Doritos. Can’t it find a little pigment to keep my hair colored?

This month, a new cohort of medical school graduates began their residencies. It’s no secret that medical training is an intense, sometimes grueling, process. But a new study, one of the first of its kind, shows how long hours, disrupted sleep and constant stress can take a biological toll on newly minted doctors. Down to the level of their genes.

Researchers at the University of Michigan tested the DNA of 250 first-year medical residents around the country. They took samples of their saliva to examine the length of their telomeres — the protective caps at the ends of chromosomes that prevent DNA damage — before and after the first year of residency.