An Qing's native, Dai Sheng, was flighty and dissolute in his youth, with a reputation for reckless abandon. One day, returning home drunk, he encountered his older cousin, Ji Sheng, who had been dead for many years. Muddled by drink, Dai Sheng failed to recall his cousin’s demise and asked, "Where have you been working lately?" Ji Sheng replied, "I am a spirit. How could you forget?" Dai Sheng suddenly understood but showed no fear, inquiring instead, "Then, Cousin, what post do you hold in the netherworld?"

Ji Sheng stated, "I work under the King of Reincarnation, overseeing the Register of Life and Death." Dai Sheng pressed, "Surely you are intimately familiar with the fortunes and misfortunes of the mortal world?" Ji Sheng affirmed, "It is my duty, how could I not know? However, the Register is incredibly detailed; unless they are immediate kin or close friends, I cannot recall every name. Three days ago, while briefly examining the scrolls, I saw your name listed."

Dai Sheng urgently asked, "I wonder how the Lord of the Underworld judges me?" Ji Sheng delivered the harsh truth: "To be frank, due to the multitude of your misdeeds, you are destined for the darkest hell upon your death." Dai Sheng was terrified, the drunkenness vanishing instantly. He pleaded, "Cousin, you must save me." Ji Sheng responded, "This is beyond my power; only by abandoning evil and embracing virtue can you save yourself. But your record is overflowing with vice; nothing short of a monumental act of goodness can atone. Yet, you are merely a poor scholar—what great good can you possibly perform? Even if you performed one good deed daily, it would take years to dispel this doom, which is too late. Still, every little bit accumulates. Though death may be inevitable, once in hell, there might yet be a chance for advancement."

Hearing this, Dai Sheng burst into tears, falling to the ground to beg; when he looked up again, Ji Sheng had vanished. Dai Sheng felt utterly lost and returned home in a gloomy stupor. From that moment on, he resolved to turn over a new leaf and live a reformed life.

Previously, Dai Sheng had been having an affair with the young wife of his neighbor. The neighbor learned of it and chose to endure the shame, intending to catch the pair in the act and apprehend them both. Unexpectedly, Dai Sheng renounced his wicked ways and ceased contact with the woman. The neighbor, unable to quell his fury, harbored a deep hatred.

One day, the two met in the fields. The neighbor approached Dai Sheng under the pretense of civility, luring him near a well, and when Dai Sheng’s guard was down, he shoved him into the water. The well was several zhang deep; Dai Sheng believed death was certain. Fortunately, the well was dry except for a small pool, and the bottom was soft mud. Dai Sheng did not die but was knocked unconscious.

Around midnight, Dai Sheng slowly awoke. Finding no way out and overcome by fear, he could not help but cry out loudly. The neighbor, fearing he might survive, came to check late that night. Hearing Dai Sheng’s desperate calls, the neighbor was gripped by terror. He quickly gathered several large stones and haphazardly threw them into the well, intending to smash Dai Sheng to death.

Dai Sheng pressed himself tightly against the well wall, daring not to make a sound. After throwing stones for a while, the neighbor remained unconvinced. He mused, "I don't know if that thieving scholar is truly dead. The silence now suggests he probably perished. But perhaps he merely fainted. Might as well finish the job and send him on his way." With this thought, he fetched a shovel, began scooping earth, and filled the bottom of the well until it was about as high as a man, then shouldered the tool and walked away whistling.

The well was pitch black and silent, the conditions akin to hell. Surrounded by damp gloom and lacking sustenance, Dai Sheng knew his end was near. Just as he was fretting, he suddenly noticed a small cave in the well wall, about a few chi high. Dai Sheng was overjoyed and crawled into the recess, seeking a path to freedom. But after crawling just a few steps, water dripped down, and three steps ahead, he faced standing water.

Helpless, Dai Sheng retreated back into the main shaft of the well. Initially, hunger gnawed at him, but as time passed, his body weakened to the point where even hunger faded. He thought, "There is no good deed to be done at the bottom of a dry well; all that remains is to sincerely chant Buddha's name." With this thought, he began uttering Buddhist invocations without ceasing.

Before long, phosphorescent lights flickered within the cave, flashing on and off, filling the hollow with ghostly flames. Dai Sheng knew this was unnatural but forced himself to remain calm, murmuring to himself, "I heard that marsh gas lights are caused by wronged spirits. Though I have survived this long, death awaits me eventually. If you esteemed spirits wish to converse, I am all ears; it might alleviate some loneliness." As he finished speaking, the ghostly lights slowly drifted closer, floating just above the water's surface, and within each light, a human shape appeared, only half the height of a living person.

Dai Sheng inquired, "Where do you all come from?" The spirits replied, "This place was once a coal pit. When the master was digging coal, he accidentally disturbed an ancient tomb, angering Lord Longfei. In his rage, he summoned the underground river, drowning forty-three of us. We are all victims of that flood."

Dai Sheng asked, "Who is Lord Longfei?" The spirits answered, "He is the owner of the ancient tomb; his exact identity is unknown. We only know he was a very learned scholar, now serving under the City God. He regrets causing our deaths by accident, and every few days, he visits this cave to offer us gruel and water. But having been soaked in cold water for so long, we can never attain reincarnation. If you, young master, ever find a way out, please retrieve our bones and rebury us elsewhere; we would be eternally grateful." Dai Sheng assured them, "Rest assured, if I can get out, I will do my utmost to help. But stuck in this deep well, the hope of seeing daylight again seems faint."

After talking for a while, Dai Sheng, overcome by boredom, began teaching the spirits to chant sutras. Several days passed this way—sitting when awake, sleeping when tired—the monotony was extreme. One day, as they were all chanting, a light suddenly appeared from the depths of the cave. The spirits rejoiced, "Lord Longfei is here! Hurry and prepare the meal." They invited Dai Sheng to join them. Dai Sheng worried about crossing the water, but the spirits insisted, lifting him by his arms and carrying him into the recess. Dai Sheng felt his body become light, and he seemed to skim across the water's surface. They traveled through winding paths for half a li until they reached a residence.

Before them stood a set of steps leading up to a large hall. On a table sat a giant candle, thick as a man's arm, casting a soft, bright glow. Having been long confined to darkness, Dai Sheng could not contain his joy at seeing the light. He looked intently and saw an old man seated in the hall, dressed in the robes and cap of a scholar.

Dai Sheng stopped, hesitant to approach, but the old man had already seen him and asked, "You look unfamiliar, young sir. From where do you hail?" Dai Sheng recounted his story truthfully. The old man was astonished and pleased, exclaiming, "So, you are my descendant in later generations!" Dai Sheng looked utterly bewildered, not understanding why. The old man explained, "My name is Dai Qian, courtesy name Longfei. Dai Tang must be your ancestor; he is my grandson. However, that man had a corrupt heart, colluding with greedy merchants to mine coal near my grave, robbing me of peace even in death. Unable to bear such indignity, I enacted a small spell, channeling water to collapse the mine and severely punish him. I wonder what became of him later?"

Originally, the Dai clan had five main branches, with Dai Tang being the eldest. There were extensive coal deposits near the ancestral tomb. A wealthy merchant in the county bribed Dai Tang for extensive mining operations. His clansmen, intimidated by Dai Tang’s authority, dared not speak out despite their anger. Later, when the flood destroyed the mine, all the miners perished. The families of the deceased were furious and brought a complaint to the magistrate. As the merchant and Dai Tang were both principal culprits, the county magistrate severely flogged both men, confiscated their property, and used it to compensate the victims. Consequently, Dai Tang’s family fortunes declined until they were utterly destitute. Dai Sheng had heard these details from his ancestors and recounted them precisely now.

The old man listened intently, concluding, "A dissolute descendant like Dai Tang deserved such retribution. My Dai lineage has always been one of scholars. Since you have arrived here, you must not neglect your studies." He then produced several books, ordering Dai Sheng to study them—over a hundred essays composed in the rigid bagu style.

From then on, Dai Sheng studied in the cave. The great candle in the hall burned brightly; even without being replaced, it never extinguished. There were no stars in the cave, making it impossible to gauge the passage of time. After an unknowable period, Dai Sheng applied himself diligently, eventually memorizing the entire collection of over a hundred essays, reading each one over four thousand times until it was deeply etched into his mind.

One day, the old man said, "Your sins have been accounted for; you will soon return to the surface. My tomb is close to the coal pit, and the chilling wind stings my bones daily. When you return, remember to rebury me properly; the eastern suburbs have excellent feng shui for that." Dai Sheng readily agreed. The old man summoned the spirits and commanded them to escort Dai Sheng back to the well bottom to await rescue.

After Dai Sheng disappeared, his family searched everywhere. Despite repeated efforts, they found nothing. His wife, unwilling to remain a widow, remarried. There was no news of his son, and his aging mother was consumed by anxiety, appealing to the magistrate for help. The county magistrate interrogated many suspects to no avail. Three or four years passed, the magistrate retired to his fields, and the case was shelved, unpursued.

Not long after, some villagers began clearing out the old well. Inspecting it, they discovered Dai Sheng unconscious at the bottom. Upon touching him, they found his skin warm and his breathing faint. They carried him back to the village and notified his relatives. Several days later, Dai Sheng revived and recounted the entire sequence of events. Upon learning that the neighbor was the perpetrator, everyone was incensed, declaring they would bring him to justice. Dai Sheng asked about the neighbor’s fate; the others gave a brief summary.

It turned out that after Dai Sheng fell into the well, the neighbor, shamed by his wife’s infidelity, murdered her. Her father, upon learning of his daughter's death, was grief-stricken and enraged, reporting the matter to the authorities. The magistrate issued an order to arrest the neighbor, who was imprisoned and severely tortured for a full year until he was reduced to a skeleton barely covered in skin before being released. Upon returning home, the neighbor heard that Dai Sheng had reappeared and fled that very night.

Hearing this, Dai Sheng sighed, "It is not truly his fault; I seduced his wife first. Even falling into the well and suffering was a fate I brought upon myself. We should not cause him trouble."

A few days later, the well water receded. Dai Sheng hired men to descend and retrieve the bones of the wrongfully killed miners, burying them together in one plot. He then purchased coffins, respectfully interred the remains of Lord Longfei, and reburied him in the eastern suburbs. Later, Dai Sheng successfully passed the Imperial Examination to become a Juren. Every spring and autumn during ancestral rites, he would visit the grave in the eastern suburbs, an observance he maintained year after year.