Fact1: Richard is sent to buy bag of nails for building treehouse, Fact2: rotunda art melting washes over him and library turning them into illustrations, Fact3: Pagemaster sends him through fiction section toward green neon exit sign, Fact4: group is separated after Moby-Dick attacks following whale 's battle with Ahab, Fact5: Richard awakens finding Adventure Fantasy and Horror lying next to him as real books
Output: Pessimistic 10yearold Richard Tyler lives life based on statistics and fears everything. His exasperated parents have tried multiple ways to build up the courage of their son, but to little success. Richard is sent to buy a bag of nails for building a treehouse. However, Richard gets caught in a harsh thunderstorm and takes shelter in a library. He meets Mr. Dewey, an eccentric librarian who insists he is in need of a special book and gives him a library card, despite Richard explaining he is only sheltering from the storm. Searching for a phone, Richard finds a large rotunda painted with many famous literary characters. He slips on water dripping from his coat and falls over, knocking himself out. Richard awakens to find the rotunda art melting, which washes over him and the library, turning them into illustrations. He is met by the Pagemaster, the mythical Keeper of Books and Guardian of the Written Word. Richard asks for directions to the exit so the Pagemaster sends him through the fiction section toward the green neon exit sign. Along the way, Richard befriends three anthropomorphic books: Adventure, a swashbuckling piratelike book; Fantasy, a sassy but caring fairy tale book; and Horror, a fearful Hunchbook with a misshapen spine. The three agree to help Richard if he checks them out using his new library card. Together, the quartet encounters classicfictional characters. They meet Dr. Jekyll who turns into Mr. Hyde, driving them to the open waters of the Land of Adventure. However, the group is separated after MobyDick attacks, following the whales battle with Captain Ahab. Richard and Adventure are picked up by the Hispaniola, captained by Long John Silver. The pirates go to Treasure Island, but find no treasure except for one gold coin, nearly causing a mutiny. Fantasy and Horror return and defeat the pirates. Silver attempts to convince Richard to leave with him, but surrenders when Richard threatens him with a sword. In the fantasy section, Richard sees the exit sign on the top of a mountain. However, Adventures bumbling awakens a dormant dragon. Richard tries to fight the dragon with a sword and shield, but the dragon swallows him. Richard finds books in the dragons stomach and uses a beanstalk from Jack and the Beanstalk to escape through the dragons mouth. He and the books climb the beanstalk to reach the exit. They enter a large dark room where the Pagemaster awaits them. Richard accuses the Pagemaster of causing the horrors that he suffered, but the Pagemaster reveals the journey was intended to make Richard face his fears. Dr. Jekyll, Captain Ahab, Long John Silver, and the dragon reappear in a magical twister and congratulate him. The Pagemaster then swoops Richard and the books into the twister, sending them back to the real world. Richard awakens, finding Adventure, Fantasy, and Horror lying next to him as real books. Mr. Dewey finds him, and, even though the library policy only allows a person to check out two books at time, lets him check out all three books just this once. Richard returns home a braver child, sleeping in his new treehouse with his books.