“Noah begot three sons, Shem, Ḥam, and Yefet” – but was Yefet not the eldest?, Initially, however, you should deal with the one who was righteous, born circumcised, the one whom the Holy One blessed be He associated His name with him,11“Blessed be the Lord, God of Shem” (Genesis 9:26). from whom Abraham was destined to descend, who served as High Priest,12See Genesis 14:18. Malkitzedek is identified with Shem (see Bereshit Rabbah 56:10). and in whose territory the Temple was built.13Malkitzedek was king of Salem, which is Jerusalem (see Bereshit Rabbah 56:10).
Shimon bar Ḥuta said: [Shem takes precedence] because the Holy One blessed be He delayed the punishment [of the post-Flood generation], from the Flood until the Dispersion, the numerical value of his letters – three hundred and forty years.14This is according to the midrash (Bereshit Rabba 38:2) that states that they began building the Tower of Babel immediately after the Flood.