Sequential formation of coalitions through bilateral agreements