The King of Omashu

This is episode 5 of Avatar: The LAst Airbender.

Aang and his friends arrive at the Earth kingdom town named Omashu to play on their delivery slides, which are used to send mail throughout the town. They go up to the highest part and slide down a delivery shoot, which gets them into trouble when they crash into a cabbage cart. The group is sent to the king, which instead of throwing them into the dungeon, throws them a feast. The king soon reveals that Aang is the Avatar. He then puts the kids into a prison cell and makes Aang participate in three dangerous challenges. The king held Aang's friends hostage and put a ring of "creeping crystal" on Sokka and Katara's fingers. The king said that he will only stop the crystal from covering Sokka and Katara completely is if Aang passes his tests. The first challenge was to get the key hanging on a chain in the middle of the waterfall. After Aang sails a stalagmite and a gust of air in the waterfall, the key lands right above the king's head. The second challenge had Aang look for the king's pet, Flopsie. After solving the second test, Aang had a duel against any opponent he wanted. He chose the king, thinking he was a frail old man, but he was actually fighting the Earth Kingdom's best Earthbender. After finishing the duel in one piece, Aang had to guess the king's name before his friends could be set free. Aang discovered that the king was his old friend Bumi who was trying to teach him how to think like a mad genius.