Ps 105:16-23

16When he summoned famine against the land, and broke every staff of bread,17he had sent a man ahead of them, Joseph, who was sold as a slave.18His feet were hurt with fetters, his neck was put in a collar of iron;19until what he had said came to pass, the word of the Lord kept testing him.20The king sent and released him; the ruler of the peoples set him free.21He made him lord of his house, and ruler of all his possessions,22to instruct his officials at his pleasure, and to teach his elders wisdom. 23Then Israel came to Egypt; Jacob lived as an alien in the land of Ham.