Episode 40
As Lysandre’s attempt to take over Lumiose City continues, our heroes are doing what they can to defeat him. Ash and his Pokémon have been captured, but when Alain realizes that his work with Lysandre has led to this disaster, he helps them all get free. Ash and Alain join forces to challenge Lysandre to a battle! Squishy, now revealed as the Legendary Pokémon Zygarde, is still trying to get through to Team Flare’s Zygarde—but Team Flare’s terrible machine soon brings Squishy under their control as well, as Bonnie watches in despair! The fate of the world hangs in the balance—who will be victorious?
Aired 01/09/2016EP 40 - Episode 40

Pokémon the Series: XYZ
The journey of Satoshi and his friends through the Kalos region continues! After Satoshi obtains his seventh gym badge, the group is moving toward the next town when Eureka discovers a mysterious Pokémon resting in her pochette. Soon given the name Puni-chan, it is one that even Satoshi and Serena's new Pokémon Zukan cannot identify. However, it quickly becomes apparent that Puni-chan is the target of a mysterious group clad in bright red suits known as Team Flare, aiming to capture the new Pokémon to further their agenda. But when Satoshi and the gang realize that the enigmatic organization has no intention of treating Puni-chan with any decency, they take a stand in opposition to Team Flare's plans, daring to fight back.
With Gojika's predictions looming above them, Satoshi aims for his final gym badge while Serena contests for her last Princess Key in order to be able to compete at the TriPokalon Master Class. But as Team Flare begins to move in search of the mysterious Z, the stories of Pokemon XY and Pokemon XY: Mega Evolution cross paths as Satoshi and his friends, along with Team Rocket, get caught up in a scheme that could put Kalos in great danger.
(Source: MAL Rewrite)