Bar Shalmon noticed that he was now wearing a garment just like all the demons. When he spread his arms, he found he could fly, and he sailed swiftly through the air to the palace. With these wings, he thought, he would be able to fly home.

"Think not that," said the rabbi, who seemed to be able to read his thoughts, "for thy wings are useless beyond this land."

Bar Shalmon found that it would be best for him to carry out his instructions for the present, and he set himself diligently to teach the crown prince. The prince was an apt pupil, and the two became great friends. King Ashmedai was delighted and made Bar Shalmon one of his favorites.

One day the king said to him: "I am about to leave the city for a while to undertake a campaign against a rebellious tribe of demons thousands of miles away. I must take the crown prince with me. I leave thee in charge of the palace."

The king gave him a huge bunch of keys.

"These," he said, "will admit into all but one of the thousand rooms in the palace. For that one there is no key, and thou must not enter it. Beware."

For several days Bar Shalmon amused himself by examining the hundreds of rooms in the vast palace until one day he came to the door for which he had no key. He forgot the king's warning and his promise to obey.

"Open this door for me," he said to his attendants, but they replied that they could not.

"You must," he said angrily, "burst it open."

"We do not know how to burst open a door," they said. "We are not mortal. If we were permitted to enter the room we should just walk through the walls."