A resonant beginning for the solar system's terrestrial planets