The Sumerians settled in Mesopotamia along the Tigris and Euphrates Rivers because the seasonal floods provided fertile soil for agriculture and the rivers provided reliable sources of water. They developed irrigation canals and surplus crops allowed specialization of labor into crafts and trade. Sumerian society was composed of independent city-states that practiced polytheism and were ruled by priest-kings. They invented a system of writing called cuneiform and made advances in mathematics, science, and technologies like the wheel, plow, and sailboat.