How hieroglyphs became the sacred script of the ancient Egyptians