Ancient Egypt developed along the fertile banks of the Nile River valley between 3200-600 BC. The yearly flooding of the Nile deposited rich silt that fertilized the soil and allowed the Egyptians to develop a strong agricultural economy. Egyptian society was highly stratified, with pharaohs at the top considered god-kings. The Egyptians built massive pyramids and temples and developed hieroglyphic writing and calendar systems. After a period of decline, a Middle Kingdom arose that strengthened trade and expanded irrigation systems before Egypt was conquered by Hyksos invaders around 1640 BC.