The final presidential debate of the 2012 campaign ended at 11 p.m. Eastern time Monday in Boca Raton, Fla.

Meanwhile, up the East Coast in New York City, the writing staffs of four late-night TV comedy/variety shows already were beginning to pitch hundreds upon hundreds of jokes, video mash-ups and sketch ideas to play off the face-off between President Barack Obama and challenger Mitt Romney. By Tuesday morning, they’d whittled those ideas down to a select few, and hurried to make those bits funny enough to make it to air that night.

How do these comedy writers do it?

The head writers for Late Show with David Letterman, Late Night with Jimmy Fallon, The Daily Show with Jon Stewart, and The Colbert Report shared their process of political parody in a panel for the 2012 New York Television Festival moderated by Willie Geist from MSNBC’s Morning Joe (and now also NBC’s Today). While they all start from the same point — gathered around TVs to watch not only the debate, but also the follow-up coverage and analysis from the three major cable news channels — they all reached different finishing lines with their own perspectives on what was funny about the presidential debate, and how best to reflect that through the viewpoint of their respective hosts.

Their individual approaches from Monday night’s debate through Tuesday afternoon’s tapings varied. Here they explain in their words how they looked for and found the jokes, followed by video clips of how their finished comedy products looked when they aired late Tuesday night.

Late Show with David Letterman (CBS)

Justin Stangel — who with his brother, Eric — have served as longtime co-head writers for Letterman:

“The writers were in at about 8:30, 9 o’clock. We had a big writers meeting today, we were going through everything based on the debate last night. Pitching videotaped pieces and stuff, for the first two acts of the show. We had about eight or nine pieces we really liked, working on that for the rest of the day. We had, I think, four or five very strong videotaped pieces. And right before the show, as Dave is putting the final monologue together, he’s like, ‘Yes, yes, I don’t think this one’s making the trip with us tonight.’ And the ones you think were fun, were great, but it’s just like, ‘Oh. But that one was good, too! We spent the last eight hours on it. Oh my God! We have a guy who was sitting in a windowless edit room all day. He’s going to be hanging himself in the kitchenette later.

“But then, my brother, Eric, had an idea. At the end of the monologue, Dave always says, ‘Ladies and gentlemen, Paul Shaffer!’ And then Paul plays something, and Dave will tease what’s coming up next. ‘After the break we have a Top Ten list and Rachel Maddow.’ And so we did that tonight, and then he walked over and and shook Paul’s hand, and Paul came around and they shook hands. They were talking like the two candidates at the end of all the debates. And then we had their fake wives and children all come out, and hug. We rehearsed it. We rehearsed it like eight or nine times without Dave. We were showing it to him later, to try to sell him on it. We have two staffers who are unusually tall. And very good-looking. Dave was somehow entertained that these two giant men were his young boys. And I think that’s what got it on the air. ‘They’re my sons? OK, let’s do it.’ So I’m casting those guys in everything we do from now on.

“And we did as much as we could. And even stuff that we picked to do, to be in the show, at some point during the show we started running over, and we started making cuts as the show was going on. So a lot of stuff — we basically have, like, two shows’ worth of material, or a show-and-a-half for every show that airs. We just try not to take it personally as it gets tossed, and it will never see the light of day again.”

Here was Dave’s monologue from Tuesday, which included a video montage of “zingers” from Obama during the debate, a joke about their lapel pins, and that handshake with Paul:

The Daily Show with Jon Stewart (Comedy Central)

From Steve Bodow, co-executive producer and former head writer:

“The writing staff is about 10 people. We also have a staff of producers who are the ones who rustle, and find and edit all the videotape. So some combination of those two staffs — maybe 15 people in all — were in the writers’ room last night watching the debate together. And yelling at the TV, and taking notes and just figuring out among us what we wanted to do, for the hour-and-a-half that the debate is on. By the end of it, we’ve got some ideas for specific jokes, and also starting to form some ideas for what bigger angles and takes might be. The debate ends, there also are people watching at home the cable networks, their reactions to this, so those of us who were watching the debate live don’t have to worry about that. And then we have a brief conversation. Maybe 20-30 minutes. Among those of us who are there, and then, on big events like that, Jon will call in and share whatever he’s thinking about it as well. At the end of that time, we’ve got a series of ideas for what assignments need to get out to the writers and producers.

“So last night, one person who was sort of on loose jokes was like, Boca Raton is a funny thing, and, Bob Schieffer is a funny thing. Then there’s, we also did, obviously, Romney clearly had pivoted to some extent in the views that he was expressing, and so we started to think about, what was, what could we go back and find, to express the change that we just saw him go through. So that was a thing that people were thinking and talking about….This sort of Freaky Friday thing that happened, between the first debate and the third. The first debate, Obama was basically asleep. And then Romney was this alpha bulldog. That reversed exactly, so we started looking for what’s the right take we could use to illustrate that idea. Those writers started writing that stuff. Meanwhile, at home people were watching networks, taking notes on that.

“This morning, we came in, had sort of a catch-up meeting to see, do we still think what we thought last night when it was late and we were tired, then we refine some of the assignments a little bit. The writers get a couple of hours to make first passes. From there, it’s a series of meetings and iterations on what the scripts will be, leading up to a 4 o’clock rehearsal and a final rewrite, and then the show.”

What aired Tuesday night at the top of the show, with video showing Romney and Republicans pre-debate attacking Obama’s foreign policy, followed by footage of Romney’s agreement with Obama during the debate. The segment is callde “We Missed NLCS Game 7 For This”:

And this on Romney’s concept of “leadership.” Stewart also zeroed in on zingers, while also taking a moment to poke fun at his own mockery of hack comedy.

The Colbert Report (Comedy Central)

Barry Julien, head writer:

Julien said the Colbert and Daily Show staffs don’t communicate to coordinate their broadcasts, because they don’t need to worry about overlap.

“Stephen’s character essentially is the polar opposite of Jon’s persona, and so, things will just come out in a different voice. We do the same thing. We get all our writers, last night, were there until about midnight watching the debate, and then some of the coverage afterward on the various cable news networks. We pitch around. We’re doing basically the same thing, pitching jokes while the debate is going on, and then having a discussion afterward to figure out, ‘here’s a take, here’s a take, these are directions we can go.’ And then we came in today with more jokes, more pitches. We have a morning meeting, we have a couple of morning meetings where we bounce ideas around. And then we assign stuff out. Then we end up with like 18 minutes of stuff to fill a nine-minute hole. And then it’s just a bloodbath from there. We’re just going around beheading jokes and bits, and cutting out anything that’s not really working. We rehearse later than you guys (at The Daily Show), up around 5:30 p.m., quarter-to-six for rehearsal. Same thing, we do a rewrite between rehearsal and taping. But, yeah. For us, it’s really about finding what is Stephen’s — because he’s very much on a mission. That’s where someone like him is coming from. He’s like they really are saving America. So, in what way is he viewing everything he says as, ‘You have to know this, because I am saving your life by telling you.’ And so, we have to find ways to frame an argument that he’s making, then find jokes that serve that argument.”

What aired Tuesday night at the top of the show:

Late Night with Jimmy Fallon (NBC)

A.D. Miles, head writer:

“We do a mix of pre-tape and live, and then we also just comb through Twitter, and steal jokes.” (laughter) “No. We come in in the morning. We’re lucky that Jimmy kind of landed on a pretty decent Mitt Romney impression. And that we found this actor named Deon Flynn — he does a surprisingly good Obama. And so most of our political stuff has been putting Mitt and Obama in a room and watching what happens to them. But our process is somewhat similar in that we came in this morning and we do sort of a virtual version of what they do. All the writers are at home in their own environments and we’re writing furiously back and forth to each other through email, sort of talking about the different angles and stuff. Then in the morning, we come in, we have a morning meeting. We had probably about five pieces this morning that were competing for screen time. And we ended up going with our cold open, which you’ll see tonight. A post-debate greenroom situation, with Barack and Mitt, and some good-natured ribbing will have occurred.

“That happens at about 10 o’clock. We write from about 10 to about 12, and then we show Jimmy like three or four, he picks the one he likes the best. And we actually have a process where we rehearse our monologue every day in front of a tour group — a test audience of about 50 to 75 people. It allows us to really try stuff out, and now that we’ve been doing pre-taped pieces like our cold open, we can tape that in front of the tour group, and we do it a couple of times. Take the best version of it. It gives the illusion that we’re doing something live.”

This was the “best version” of that cold open sketch from Tuesday night with Fallon’s Romney in the post-debate greenroom with Obama: