NEW YORK - Locked in a tense race with time running out, President Barack Obama and Republican challenger Mitt Romney took time off to exchange light-hearted jabs and make fun of each other on Thursday in a joint appearance at a high-profile charity dinner.Two days after a brutal debate in which they exchanged verbal blows and stalked each other on stage, Obama and Romney greeted each other warmly, dressed formally in white tie and tails. But the combativeness of the campaign trail was ever-present as the two foes gave back-to-back speeches at the 67th annual Alfred E. Smith Memorial Foundation Dinner.Romney, speaking first, said Obama, who wants to increase taxes on the wealthy to help fund government programs, must have had some thoughts as he looked out at the crowd of wealthy people at the dinner."You have to wonder what he's thinking: So little time, so much to redistribute," he said.Obama, when it was his turn, made fun of Romney's vast wealth."Earlier I went shopping at some stores in Midtown. I understand Governor Romney went shopping for some stores in Midtown," he said.The Al Smith dinner is a glittering affair at the Waldcrf-Astoria hotel where New York's high society dined on poached lobster and rack of lamb and contributed $5 million for various children's charities.Obama and Romney, facing a third and final debate Monday in Florida, sat close to each other at the dinner, separated only by Cardinal Timothy Dolan, the archbishop of New York who spoke at both the Republican and Democratic conventions in late August and early September.The event is an annual speaking opportunity for presidents or president aspirants to test their comic skills with self-deprecating jokes usually written up by clever speechwriters.Obama made light of his much-panned performance at his first debate with Romney on October 3. He said at the second debate, where he was judged the winner, he had been well-rested because of the "nice long nap I had at the first debate."Biden in both candidates' cross-hairsRomney also was self-deprecating, noting that the way he prepared for the debate was to "refrain from alcohol for 65 years." As a practicing Mormon, the former Massachusetts governor abstains from alcohol.Obama, who frequently credits himself with ordering the mission that led to the death of al-Qaida leader Osama bin Laden in 2011, noted that the last debate is about foreign policy."Spoiler alert: We got bin Laden!" he said.Romney tweaked Obama on the high jobless rate, saying its recent small decline meant only one thing: "You're better off now than you were four weeks ago."Obama said he and Romney have some things in common, like their unusual middle names. Romney's is Mitt. "I wish I could use my middle name," said Obama, whose middle name is Hussein.If there was one thing they had in common, it was their ability to make fun of Vice President Joe Biden, Obama's gaffe-prone No. 2.Obama said he sometimes hears that he is getting old and has lost a step and when he does, he says, "Settle down, Joe, I'm trying to run a Cabinet meeting."Romney said when Biden speaks, it usually is to Romney's benefit, so much so that whenever his remarks are on TV it should be accompanied by a recorded message like those used in campaign ads: "I'm Mitt Romney, and I approve this message."Obama got in a jab at the Republicans' use of Hollywood legend Clint Eastwood at Romney's convention. Eastwood was panned for talking to an empty chair on stage as if Obama was sitting in it."Please take your seats," Obama told the crowd, "or else Clint Eastwood will yell at them."The tone of the evening was set with introductory remarks by Al Smith IV, who could not resist teasing Romney for saying at the debate that he sorted through "binders full of women" in trying to put together a diverse cabinet as governor of Massachusetts."I want to say a special welcome to all of the accomplished women here tonight. It's good to see you made it out of those binders," Smith said to laughter.The dinner started in 1945 in tribute to a former Democratic New York governor Smith, who lost the 1928 presidential election to Republican Herbert Hoover in a landslide.Among the 1,600 guests were representatives from two of New York's major industries - media and Wall Street money. Spotted in the crowd were ABC television talk show host Katie Couric and Fox News executive Roger Ailes, as well as Steve Schwarzman, chief executive of private equity firm Blackstone Group, and Bank of America CEO Brian Moynihan.