Solar wind interaction with the terrestrial planets