For the given portion of the diagram, the sequence will go as follows:
Sedimentary rock ----> Heat and pressure ----> metamorphic rock --->melting ----> magma
Therefore, from the given choices, the correct choice would be:
d. P represents metamorphic rocks and Q represents melting
Note: For the complete rock cycle, refer to the attached image.