How do the masses and densities of different layers in the Earth’s interior compare with each other?