Passing through a giant molecular cloud: “Snowball” glaciations produced by interstellar dust