Shaping of the Inner Solar System by the Gas