A Hans Christian Andersen
tale about a soldier who comes upon a witch who tells him how to obtain lots and lots of money, if only he will bring her a tinder-box that got left down inside a passageway under an old oak tree by mistake. The soldier goes down and finds three enormous dogs, guarding in turn a chest of copper coins, a chest of silver coins, and a chest of gold coins. When he brings up some gold he is reminded of the tinder-box and goes to get it. But the witch won't tell him what is so special about the tinder-box, even upon threat of beheading. So the soldier beheads the witch. It isn't til later that he discovers by accident that the tinder-box can be used to summon the dogs, who can bring him more money.
Eventually the soldier finds that he's fallen in love with a princess, but the King and Queen have heard a prophecy that she will marry a mere common soldier and are having none of that, so they keep the Princess locked away in a Copper Palace all the time. He utilizes the summoning tinder-box to get a dog to bring the princess to him. Eventually the King and Queen figure out that someone has been spiriting the Princess away overnight, and have someone follow the dog. When they find the house, they mark it with chalk. The dog sees the chalk mark and marks all the doors on that street. Eventually the Queen fashions a bag that she fills with flour, into which there has been placed a small hole so that there will be a flour trail that they can follow. The dog doesn't notice the flour trail, and the soldier is arrested and sentenced to hanging.
He doesn't have his tinder-box, so he gets a boy to go to his apartment and bring him the tinder-box. When he's to be hanged, he asks to be allowed one last smoke, and uses the tinder-box to summon all three dogs. The dogs throw the judges and councillors so high into the air that they are killed when they hit the ground. The King is unmoved by this, so the dogs do the same to him and the Queen. The people proclaim the soldier to be the king, and he marries the princess and gets her out of that copper castle.
This story is available online here