What was the main reason early civilizations developed writing?

They wanted to record their myths and legends for future generations.

They needed a way to make and keep records.

They needed to express themselves artistically.

They wanted to be able to communicate with distant cities.