The constitution of the Roman Republic consisted of a set of guidelines and principles passed down mainly through precedent. The constitution was largely unwritten and uncodified, and evolved over time. Rather than creating a government that was primarily a democracy (as in ancient Athens), an aristocracy (as in ancient Sparta), or a monarchy (as in the Roman state before and, in many respects, after the Republic), the Roman constitution mixed these three elements, setting up three separate branches of government: