The king had the pit dug, and commanded all the maids belonging to the palace to try to jump it. All of them tried, but only one succeeded.
That one was found to be a man!!
Thus was the queen satisfied, and the faithful old vizier saved.
Afterwards, as soon as could be, the vizier's son married the old farmer's daughter; and a most happy marriage it was.
The Demon with the Matted Hair 
This story the Teacher told in Jetavana about a Brother who had ceased striving after righteousness. Said the Teacher to him: "Is it really true that you have ceased all striving?" "Yes, Blessed One,"
he replied. Then the Teacher said: "O Brother, in former days wise men made effort in the place where effort should be made, and so attained unto royal power." And he told a story of long ago. 
Once upon a time, when Brahmadatta was King of Benares, the Bodhisatta was born as son of his chief queen. On his name-day they asked 800 Brahmans, having satisfied them with all their desires, about his lucky marks. The Brahmans who had skill in divining from such marks beheld the excellence of his, and made answer:
"Full of goodness, great King, is your son, and when you die he will become king; he shall be famous and renowned for his skill with the five weapons, and shall be the chief man in all India." On hearing what the Brahmans had to say, they gave him the name of the Prince of the Five Weapons, sword, spear, bow, battle-axe, and shield.
When he came to years of discretion, and had attained the measure of sixteen years, the King said to him:
"My son, go and complete your education."
"Who shall be my teacher?" the lad asked.
"Go, my son; in the kingdom of Candahar, in the city of Takkasila, is a far-famed teacher from whom I wish you to learn. Take this, and give it him for a fee." With that he gave him a thousand pieces of money, and dismissed him.
The lad departed, and was educated by this teacher; he received the Five Weapons from him as a gift, bade him farewell, and leaving Takkasila, he began his journey to Benares, armed with the Five Weapons.
On his way he came to a forest inhabited by the Demon with the Matted Hair. At the entering in of the forest some men saw him, and cried out:
"Hullo, young sir, keep clear of that wood! There's a Demon in it called he of the Matted Hair: he kills every man he sees!" And they tried to stop him. But the Bodhisatta, having confidence in himself, went straight on, fearless as a maned lion.
When he reached mid-forest the Demon showed himself. He made himself as tall as a palm tree; his head was the size of a pagoda, his eyes as big as saucers, and he had two tusks all over knobs and bulbs; he had the face of a hawk, a variegated belly, and blue hands and feet.
"Where are you going?" he shouted. "Stop! You'll make a meal for me!"
Said the Bodhisatta: "Demon, I came here trusting in myself. I advise you to be careful how you come near me. Here's a poisoned arrow, which I'll shoot at you and knock you down!" With this menace, he fitted to his bow an arrow dipped in deadly poison, and let fly. The arrow stuck fast in the Demon's hair. Then he shot and shot, till he had shot away fifty arrows; and they all stuck in the Demon's hair. The Demon snapped them all off short, and threw them down at his feet; then came up to the Bodhisatta, who drew his sword and struck the Demon, threatening him the while. His sword it was three-and-thirty inches long stuck in the Demon's hair! The Bodhisatta struck him with his spear that stuck too! He struck him with his club and that stuck too!
When the Bodhisatta saw that this had stuck fast, he addressed the Demon. "You, Demon!" said he, "did you never hear of me before the Prince of the Five Weapons? When I came into the forest which you live in I did not trust to my bow and other weapons. This day will I pound you and grind you to powder!" Thus did he declare his resolve, and with a shout he hit at the Demon with his right hand. It stuck fast in his hair! He hit him with his left hand that stuck too! With his right foot he kicked him that stuck too; then with his left and that stuck too! Then he butted at him with his head, crying, "I'll pound you to powder!" and his head stuck fast like the rest.
Thus the Bodhisatta was five times snared, caught fast in five places, hanging suspended: yet he felt no fear was not even nervous.