Water came to the young Earth thanks to gas giants