Ali Baba hid behind a tree and watched as the thieves entered the cave. He saw that the entrance to the cave was a large rock that could only be opened by saying a magic word. The magic word was "Open, Sesame!"
The thieves opened the cave and went inside. Ali Baba, who wanted a way out of his poverty waited for the thieves to leave the cave. When the thieves were gone, he said the magic word himself and entered the cave. The cave was filled with treasure. There was gold, silver, jewels, and silks. Ali Baba took as much treasure as he could carry and returned home.
Ali Baba's brother Qasim, was told about the riches in the cave. Qasim was very interested in the money. He also went to the cave and said the magic word. However, when it was time to leave, he forgot the magic word. He became trapped in the cave. Later on, Ali Baba visited the cave to retrieve his brother's body and found him with the treasure. He took the body home and buried him.
The forty thieves returned to their cave and found Qasim's body. They were very angry and they realized the secret passageway had been discovered. They decided to return to the village to find the person who had robbed them.
The thieves went to the village and they began to search for Ali Baba. They looked in every house, but they could not find him. Finally, they came to Ali Baba's house and they knocked on the door. Ali Baba's wife answered the door. The thieves asked her if she knew where Ali Baba was.
Ali Baba's wife was very clever. She knew that the thieves were looking for Ali Baba and she did not want them to find him. She told the thieves that she did not know where Ali Baba was. She said that he had left the village and she did not know when he would return. Ali Baba's wife knew the thieves would soon realize they had been tricked. She quickly took all the treasure from the cave and hid it. She hid some in the basement, and some in the courtyard, and even in the donkey's saddlebags.
The thieves searched Ali Baba's house, but they could not find the treasure. Finally, they gave up and left the village. Ali Baba and his family were safe and they lived happily ever after.