Earth and Mars: early thermal profiles