Indonesia's new vice president is Hamzah Haz, who leads the United Development Party (PPP). With 58 seats, this is the third largest party in parliament.
Like former president Abdurrahman Wahid, Haz is identified with Muslim traditionalism, though in other respects he was not a supporter of the former leader.
As Megawati's deputy, Haz will have to live with his own antipathy, voiced at the time, to electing a woman as president.
Personal differences apart, Haz's election as vice president will be considered a good power balance, uniting as it does the Muslims with the broadly secular nationalists represented by the new president.
Runner-up
The runner-up in the voting for vice president was Akbar Tanjung, who leads Golkar - the second largest parliamentary party and the third major power bloc.
Golkar suffers from its close identification with the former dictator, Suharto. However, Akbar Tanjung remains an important power broker by virtue of the fact that he chairs the lower house of parliament, the DPR.
The three together - Megawati, Haz and Tanjung - command 331 of the DPR's 500 members.
Indonesians may consider that the alliance of Megawati and Hamzah Haz gives the best chance for the future, especially if the new president delegates much of the day-to-day business of government to her deputy, as Wahid had been encouraged (but was reluctant) to do.
There is another balance in that Megawati is of Javanese/Sumatran parentage whilst Haz comes from West Kalimantan, a factor likely to appeal to outer islanders, who sometimes resent what they regard as hegemony by the majority Javanese.
A key priority for the new team will be to try to reunite the country. Indonesia has seemed badly divided in recent months, notably between the political centre and many of the provinces, where ordinary people are showing signs of being fed up with the political bickering at the centre.
Supporters of the separatist Aceh Freedom Movement want nothing to do with Jakarta, proclaiming: "We are not Indonesians." With his Muslim credentials, Hamzah Haz may be entrusted with the responsibility for solving this particular issue.
Wahid's departure
Another sign that the political crisis of the past few months is over came with former President Wahid's departure from the country for medical treatment in the US, a face-saving formula that side-steps his refusal to surrender power.
His supporters had already given up trying to keep him in office. He will be generously treated by the establishment, but his days in power are over.
What the crisis has really done is to demonstrate more clearly where power lies in Indonesia. The People's Consultative Assembly or MPR - 500 of whose 700 members are directly elected by the people - is seen to be the source of
power.
Not only does it elect the executive president, but it can fire him too if it finds him - or her - wanting. The constitution had left some doubt as to whether the MPR or the president held supreme power. Now it seems clear.
Given the authoritarian way that former President Suharto - and Mrs Megawati's father, Sukarno, before him - had led the country, with little resort to parliament, this will be considered a plus point.
Indonesia now regards itself as being in a period of reform, or "reformasi", a movement which began with the overthrow of Suharto in 1998.
That clarification achieved, the new government can afford to focus its attention rather more on running the country and solving its many problems, notably economic ones, that critics of Wahid's presidency believe have been neglected for too long.