In 1874 Imperial Russia, Prince Stephan "Stiva" Oblonsky's wife, Princess Daria "Dolly", banishes her husband from their home due to his infidelity. Stiva's sister, Anna Karenina, a well off and liked socialite living in St. Petersburg with her older husband, Count Alexei Karenin, and their son, Seryozha, travels to Moscow to persuade Dolly to forgive Stiva. Meanwhile, Stiva meets his old friend Konstantin Levin, a wealthy land owner and aristocrat who is looked down upon by Moscow's elite for preferring country life to city life. Levin professes his love for Stiva's sister-in-law, Princess Katerina "Kitty" Alexandrovna, and Stiva encourages him to propose. However, Kitty declines as she hopes to marry Count Alexei Vronsky. Later, Levin meets with his elder brother Nikolai, who has given up his inheritance and taken a prostitute named Masha as his wife. Nikolai suggests that Levin marry one of the peasants on his estate. On the train to Moscow, Anna meets Vronsky's mother, Countess Vronskaya, and once there Anna meets Vronsky himself, and they have immediate mutual attraction. When a railway worker is killed in an accident at the station, Vronsky is seen by Anna, Stiva, and the Countess giving a large sum of money to the worker's family. Anna convinces Dolly to take Stiva back. At a ball that night, Kitty attempts to dance with Vronsky, but he dances with Anna, attracting the attention of everyone in attendance and leaving Kitty heartbroken. Anna boards a train to St. Petersburg, but at a rest stop notices Vronsky, who declares that he must be wherever she goes. She tells him to go back to Moscow, but he refuses.In St. Petersburg, Vronsky visits his cousin Princess Betsy Tverskaya, a friend of the Karenins, and begins to show up at all the places Anna and Betsy visit. Vronsky flirts openly with Anna at a party, which catches Karenin's attention. He suggests they go home, but Anna chooses to stay. Vronsky tells her of his intention to take a promotion in another city but Anna persuades him to stay and the next day they meet at a hotel and make love.Stiva visits Levin at his country estate and informs Levin that Kitty and Vronsky are no longer to be married. Levin focuses on living an authentic country life, working in his fields with his workers and contemplating taking one of their daughters as his wife, as his brother had suggested.Karenin hears that his wife and Vronsky are in the country estate and surprises them there, after she reveals to Vronsky that she is pregnant. Later she encounters Karenin who suggests he join them for the horse races that evening. The races begin, and Anna betrays her feelings for Vronsky as his horse falls and injures him. On their way home Anna admits to Karenin that she is Vronsky's mistress and wishes to divorce him. Karenin refuses and instead confines her to home. Levin sees Kitty in a passing carriage and realises that he still loves her. Anna receives Vronsky at her house in St. Petersburg and as she complains about why he failed to come earlier, he tells her that his duties as an officer have delayed his visit. Karenin comes back home to find out that Vronsky was visiting Anna, as seen from the love letters found in her desk. Meanwhile, Levin and Kitty are reunited at Stiva's house, and Karenin announces he is divorcing Anna, who begs him to forgive her, which he refuses. After dinner, Levin and Kitty announce their love to each other and decide to marry. Anna goes into premature labour. With Vronsky at her side, she berates him, saying that he could never be the man Karenin is. Karenin comes back knowing that she is going to die and forgives her. Anna survives and initially decides to stay with her husband. Princess Betsy calls on Anna to discuss what will happen with Vronsky now that he is back in Moscow. Anna suggests that Betsy better discuss it with Karenin, who believes that they will be reunited as a family. However, upon Anna's recovery, she chooses to be with Vronsky. Karenin refuses to grant her a divorce, but releases Anna from her confinement. She and Vronsky soon leave for Italy with Anya.Levin and Kitty return to his country estate, where the sickly Nikolai and Masha have been given a storeroom to live there. Levin tells Kitty that she doesn't have to live under the same roof as the former prostitute, but the newly matured Kitty ignores social norms and assists Masha in nursing Nikolai.Anna returns to St. Petersburg to see Seryozha on his birthday, but Karenin makes her leave after a short time. Anna now begins to suspect Vronsky of unfaithfulness. She attends the opera where the upper class audience regard her with disdain as someone who "has broken the rules". Though humiliated, she retains her poise, only to break down once back at her hotel. The next day, Anna has lunch at a restaurant where the society women avoid her. Dolly, however, joins her and tells her that Kitty is in Moscow to have her first child. Dolly says that Stiva's behavior has not changed, but she has come to accept and love him for who he is. Later, Vronsky informs Anna that he has to meet his mother to settle some accounts, but there Anna sees Princess Sorokina picking him up. Anna becomes upset, and takes the train to see if Vronsky is truly with his mother. On the way, she has hallucinations of Vronsky and Princess Sorokina making love, and laughing at her. Arriving at Moscow station, Anna says to herself, "Oh God... " and jumps under an oncoming train that kills her. The scene then flashes to Vronsky who has a shocked face as if knowing his true love has died. Levin returns home from working in the fields to find Kitty bathing their child. Stiva and his family eat with Levin and Kitty. Karenin, retired by then from serving his country, is seen in his estate, with Seryozha and young Anya playing nearby.
Output: Question: What is the name of the prostitute Nikolai takes as his wife?, Answer: Masha