A wealthy man had a handsome son who showed great promise in his studies. He decided to send the young man to Xian to take the imperial exams, in the hopes of securing a high government post. Dressed in the finest silks and mounted on a magnificent stallion, the son set out for the capital with a generous stipend from his father, enough to last him two years in the best circumstances. On reaching the capital, he heard stories of Li Wa, a celebrated courtesan in the pleasure district, and decided to see for himself. Long story short, he fell madly in love with the beautiful Li Wa, forgot his mission, and spent his money on the good life. In a few months, he ran out of money. His new friends abandoned him, and he was thrown out of his lodgings. Having sold everything, he was too afraid to go back to his father. The news reached the old man anyway, and in a rage, he searched out his son and beat him within an inch of his life, leaving him for dead by the side of the road. After recovering from the beating, the young man resorted to begging door to door for food.
One day, he was begging outside a beautiful home, when the door was opened by none other than Li Wa herself. Astounded at the sight of her former patron in rags and dire straits, she felt crushing guilt at her role in his downfall. She took him in, and with her own savings, clothed him and fed him, and urged him to resume his studies for the imperial exams, buying him all the books he needed. A year later, he sat for the exams and won first place, and was appointed the highest magistrate in the land. He asked Li Wa to go with him to his father's house to beg forgiveness. When his father saw him, he was overjoyed, for he thought he was dead. And when he heard how Li Wa had given his son his second chance, he readily gave his consent for their marriage.