<P> In a third - season episode, Sam is awed by President Bartlet's foresight and wisdom when resolving an apparent impasse among the Chinese, the Taiwanese and the United States . President Bartlet predicts that Sam will run for President someday and should not be scared; Bartlet believes that he can do it . </P> <P> During the fourth season, Sam decides to run for Congress in his home district--the California 47th in Orange County, California--in a special election held after deceased Democratic candidate Horton Wilde posthumously makes history by defeating arch - conservative Republican incumbent Chuck Webb . Sam first becomes familiar with the congressional race when he is sent to talk to Wilde's campaign manager, Will Bailey, on behalf of the Democratic Party, to convince him to drop the campaign . Will continues running the campaign with earnestness and energy after Wilde died, an act that is seen as bizarre and pointless--or, as Sam puts it to him, "a national joke". After seeing firsthand how dedicated Will is and realizing that he is a public servant in the mold of Bartlet's own senior staff, Sam becomes impressed with how he ran Wilde's campaign and offers his own name as a replacement candidate for election night in case Wilde wins, not thinking he will have to honor the promise . When Wilde does win, Sam decides not to back out but to use this opportunity to promote a truly liberal agenda in the traditionally conservative district . He goes to California with the blessing of Bartlet and his fellow White House staffers . Once he learns that Will Bailey is not going to stay on to manage his campaign, he recommends him as a temporary replacement for himself in the White House, to help Toby write Bartlet's second inaugural address . </P> <P> It is never explicitly revealed whether Sam wins or loses the election, but he is expected to lose in a landslide . President Bartlet goes to California to lend his support, taking with him Sam's friends on the senior staff, who believe campaign manager Scott Holcomb is wasting Sam's time by having him run a safe, timid campaign . In the midst of the visit, Sam learns that Bartlet is putting off announcing the Democratic budget plan Sam himself had helped design, so that Sam won't feel pressured to support it and further stigmatize himself during the election . Sam is appalled and decides to put things right . While introducing the President at a campaign event, he adds that the audience shouldn't "let him off this stage" until he has announced the budget plan . Backstage, Bartlet watches Scott Holcomb react with distress and asks why he is running Sam's campaign the way he is . Holcomb admits that he is anticipating Sam's loss and trying to smooth the way for a less divisive candidate the next time around, prompting Bartlet to (unofficially) fire him and get Toby to take over the campaign for the final weeks . Toby runs a thoroughly honest and liberal campaign, not until the very end of which does Sam realize, "I'm going to lose". Toby confirms it, explaining, "They're going to throw rocks at you next week, and I wanted to be standing next to you when they did ." They hug, and this is the last scene in which Sam appears until the end of the final season . </P> <P> Although Sam is mentioned occasionally following his departure--most notably calling Josh to tell him to "roll with the punches" after the latter unwittingly caused the defection of a Democratic Senator--he is not seen in the series until the last episodes of the seventh and final season, following the election of Congressman Matt Santos as President . Resolving the debate over the result of the California 47th's special election, it is implied that Sam was defeated by Congressman Webb and declined the promotion to Senior Counselor to the President that had been suggested by Toby . After summarily quitting politics, Sam remained in his home state of California and joined an unnamed law firm in Los Angeles which pays him a salary that would "make (Josh) puke". </P>

When does sam seaborn leave the west wing
find me the text answering this question