The composition and origin of the C, P, and D asteroids: Water as a tracer of thermal evolution in the outer belt