What type of rocks are formed by cooling magma and lava?