When the magma cools and hardens either underneath or on the Earth's surface, it produces igneous rocks.
(the magma; cools; ) (the magma; hardens underneath; ) (it; produces; igneous rocks; T:When the magma cools and hardens either underneath or on the Earth's surface)
the magma the magma it
cools hardens underneath produces
igneous rocks T:When the magma cools and hardens either underneath or on the Earth's surface