John Skillpa (Cillian Murphy), a quiet bank clerk living alone in tiny Peacock, Nebraska, prefers to live an invisible life in order to hide his secret: He has multiple personality disorder, the implied result of childhood trauma inflicted by his abusive mother. His alter ego is a woman, Emma, who each morning does his chores and cooks him breakfast before he starts the day. One day while he is using the outside yard clothesline as Emma, a freight train caboose derails and crashes into John's backyard. When his neighbors come to the scene, "Emma" enters his house, putting John's other life into the spotlight, so he is forced to tell his neighbors that Emma is his wife, married in secrecy. Forced to fool the town into believing he and his alter ego are man and wife, John and Emma must maintain their secret while in public view.The town mayor, Ray Crill (Keith Carradine), and his wife Fanny (Susan Sarandon) come to see John to try to host a political rally in his backyard in support of the incumbent candidate for the federal elections for senator. John is unwilling to do so, but Emma agrees. Fanny runs a women's shelter in the small town of 800, and convinces Emma to hold the rally in order to raise funds for her organization. She agrees, but the next day, John has a mental breakdown at work when he meets the Crills. John is afraid, under the mayor's stipulation, that the two be present for the ceremony, presenting obvious problems that would reveal his identity. He phones the railway company to have it removed immediately, in order to avoid the confrontation.One night, a young mother, Maggie (Ellen Page) appears at John's house, looking for him. She has been receiving checks from John's mother, who died a year ago, to support her and her two-year-old son's living. She wants to move out of the town with her son Jake (Flynn Milligan) in order to seek new opportunities, but is unable to procure the funds to do so. She comes to John's house to ask for money, but he just goes upstairs and becomes Emma. Not knowing Emma, Maggie feels bad, and Emma drives her home, to her trailer. There, it is revealed that Jake is, in fact, Jake Skillpa, the son of John and Maggie. Emma suggests that Maggie move into Fanny's women shelter, but she refuses, citing that the women there are "unambitious."John then visits Maggie at the shelter, agreeing to give her a ride to Madison, as well as just over $1000, his savings at the bank. Emma offers Maggie a job at the bank, in an attempt to keep Maggie in Peacock. John asks Maggie to meet him at the local motel at 11pm that night to collect the money. Emma seduces a man at the bar that night, and leads him to the motel room that John had arranged. She beats the man unconscious, lays him on the bed, and sets the motel on fire as Maggie comes to meet John. Emma, long gone, gets to feign the "death" of her "husband."When the rally takes place, Emma shuts herself in her home, ignoring the attendees. She gives the money to Maggie, telling her to leave because it is not safe here in Peacock, as well as trying to prevent the abuse that she herself had endured. The film ends with Maggie holding Jake over her shoulder as they walk down the porch steps, with Jake waving a childhood toy of John's that Emma had given him and Emma barring herself in her home.
Output: Question: who visits Maggie at the shelter?, Answer: john