Instructions: Given a scientific question, generate a correct answer to it.
Input: When a rock is altered by heat from a nearby magma, what occurs?
Output:
contact metamorphism