David Cameron had a little list. An important list. It contained the names of all the men and women whom he had lined up to hold office in the administration he expected to be forming last Friday morning, after the election results had come through.
The Tories were so sure that they were on the threshold that at 7pm on Thursday, three hours before the polling booths closed, one of Mr Cameron's aides rang Jeremy Heywood, the Permanent Secretary in Downing Street, and spent five minutes reading him the list. He also disclosed the names of some civil servants who were thought to be so tainted by association with Labour that Mr Cameron wanted them out.
Naturally, there were no Liberal Democrats on the list given to the astonished Mr Heywood, because the Conservatives confidently expected to march into power with a commanding majority in the House of Commons.
The Tories had their first shock almost immediately after voting ended at 10pm, when an exit poll predicted that they would win 307 seats, at least 15 short of a majority. The poll also, surprisingly, forecast that the Liberal Democrats would lose more seats than they gained, ending with only 59 seats.
Aware that the poll was likely to feature prominently in the first editions of the next morning's newspapers, which went to press before there were any actual results to report, Tory spin doctors issued a stream of messages warning that it was suspect. One person who believed them was the Tory blogger, Iain Dale, who rashly blogged that he would "run naked down Whitehall" if the Lib Dems really got as few as 59 seats. That was the first broken promise of the new era.
It was only when the results in what should have been winnable seats came through that the Tories realised they were in for a cruel disappointment. Early on Friday morning, it became clear that for the first time since February 1974, a general election had produced a hung Parliament, with the Liberal Democrats holding the balance.
Having been depressed by the results, Tory spirits were quickly raised again in the middle of Friday morning, when Nick Clegg arrived at the Liberal Democrats' Westminster headquarters and made an impromptu speech on the pavement, in which he implied he was ready to enter into a deal that would see David Cameron move into 10 Downing Street.
His words inspired a round of applause at Conservative headquarters, and spread gloom in Labour headquarters. Activists there had woken cheered by the news that the results were not as bad as they had feared; they had beaten the Lib Dems back into third place and stopped the Conservatives from taking office straight away. Some ministers and advisers experienced a twinge of hope that they might keep their government jobs after all. They could not understand why Mr Clegg seemed to be throwing away the chance of doing a deal to keep the Tories out.
But Gordon Brown was not dismayed. He had returned to Downing Street from his Kirkcaldy and Cowdenbeath constituency in surprisingly buoyant mood, possibly out of sheer relief that the campaign was over. At 7am, he called together three Cabinet ministers – Peter Mandelson, Andrew Adonis and Douglas Alexander – to plot how to stay in office. Lord Mandelson and Harriet Harman then took to the airwaves to remind the country that Mr Brown was still Prime Minister and had a constitutional right to try to put together an administration.
Their comments provoked fury in some quarters of the Tory party and their cheerleaders in the media. "Squatter, 59, holed up in No 10" was the front page headline of Saturday's Sun. But as the former Cabinet Secretary Andrew Turnbull, among others, pointed out, Mr Brown was not "squatting", he was doing what the constitution required him to do by staying put until a new government had been formed.
Later on Friday, Mr Brown heard that Mr Cameron planned to make a statement at 2.30pm on Friday, and decided to jump in first. At 1.45pm, he stepped out of Downing Street to make a public overture to the Lib Dems. He offered "far-reaching political reform" and an early referendum on electoral reform. It was a clever opening bid which kept Labour in the game as negotiations dragged on, and added to the pressure on Mr Cameron, whose party members were likely to rise in revolt if he failed to secure the keys to Downing Street. He made his opening bid 40 minutes after Mr Brown, making what he called a "big, open, comprehensive offer" to the Lib Dems, including an "all-party committee of inquiry on electoral reform".
Neither offer was a clincher, but it was clear the Lib Dems were going to have to conduct two serious sets of negotiations in parallel. According to what Labour sources said later, Mr Clegg was drawn as early as Friday night into the secret that Mr Brown had already accepted the inevitable and was going to resign as Labour leader. That removed one serious block to a Lib-Lab deal.
While the informal talks carried on at a frantic pace at the weekend, it was on Monday morning that talks began. Two negotiating teams walked down Whitehall in stately style, surrounded by a swarm of cameras, journalists, and onlookers, to meet in the Cabinet room, in the presence of civil servants. On the Tory side there were the Shadow Cabinet members William Hague, George Osborne and Oliver Letwin, plus David Cameron's chief of staff and old school chum, Ed Llewellyn.
The Lib Dems were represented by three of their front-bench politicians, David Laws, Chris Huhne and Danny Alexander, and by the MP Andrew Stunell. Mr Stunell stood out because at 67, he was the oldest of the participants, and the only one without an Oxbridge degree. He was there to lend his long experience of organising coalitions on local councils.
While they were locked in talks, nobody on the outside knew what was happening. Even Mr Cameron and Mr Clegg were sometimes in the dark, though in private phone calls they reassured one another they were serious about a deal.
Later on Monday, there was another meeting, away from the glare of cameras, when the Lib Dem team met Labour's negotiators, headed by Lord Mandelson. Nick Clegg and his team were scrupulous in reporting back to their MPs and peers – in contrast to the Labour leadership, who seemed intent on not consulting their increasingly mutinous MPs.
To adding to the overcharged atmosphere, Mr Brown stepped out of Downing Street to announce his intention to quit the Labour leadership later in the year. His words brought home to the Tories that they faced serious competition, and rushed Mr Cameron and his team into making two major new concessions, offering the Lib Dems a referendum on voting reform – though not on proportional representation, which was what they wanted – and seats in a coalition cabinet.
When the Lib Dem MPs met that night, they heard from all four of their negotiators and from Mr Clegg, The final speech was from Vince Cable, who by instinct was closer to Labour than almost anyone else in the party leadership. Even he said regretfully that he feared that Labour's negotiating team were not in a position to make and deliver on any worthwhile promises, given the increasingly mutinous mood of Labour MPs and their impending leadership crisis.
Talks continued for another day, but it was clear that the Labour Government was doomed, and the only decision left for Mr Brown to make was the timing of his departure. Early in the evening, the old gang – Mr Brown, Lord Mandelson, Alastair Campbell, Sue Nye, Ed Balls and Ed Miliband – assembled in Downing Street for the last time, finding the Prime Minister in surprising jovial mood, joking and making them all laugh. At 7.15pm, Mr Brown stepped outside to make his last address to the nation.
Mr Cameron has a copy of that list of names his aide had read out five days earlier. One day, it may turn up in an archive, a historical memento of the government he might have put together. Today, he will be working on a new list.