An enthralling display of literary virtuosity that eloquently captures the loves and losses of a dying man