Simple rules for making alliances work