Cast Reshape the Earth, searching your library for Maze's End and nine gates minus the number of gates already on the battlefield under your control and putting them onto the battlefield untapped.
Tap the landss for mana.
Activate Maze's End, searching your library for a tenth gate and putting it onto the battlefield, winning you the game.