Answer:
The metamorphic rock and sedimentary rock were already at this location and magma flowed into other rocks