Um Cohein tem precedência para um levita; um levita, para um israelita, [viz. (Deuteronômio 10: 8): "Naquele tempo, o Senhor separou a tribo de Levi, etc."]; um israelita para um mamzer, [o primeiro sendo "de raça pura", o segundo não]; um mamzer para um Nathin, [o primeiro vindo de uma queda não contaminada; o segundo, de um contaminado]; um Nathin para um prosélito, [o primeiro tendo sido criado conosco em santidade; o segundo não]; um prosélito de um escravo libertado, [o primeiro não tendo sido incluído em "amaldiçoado", o segundo tendo sido incluído assim]]. Quando é isso? Quando todos são iguais (eminência); mas, como entre um mamzer que é um estudioso da Torá e um sumo sacerdote que é um ignorante, um mamzer que é um estudioso da Torá tem precedência sobre um sumo sacerdote que é um ignorante, [como está escrito (Provérbios 3:15 ): "A Torá é mais preciosa que o peninim (pedras preciosas")— até (mais precioso) do que o (o sumo sacerdote), que entra no lifnai velifnim (acrônimo de "peninim"), "o santuário mais íntimo"]
Mishneh Torah, Gifts to the Poor
If we have before us many poor people or many captives, and there is not enough in the fund to sustain them, or to clothe them, or to redeem them all, a priest takes precedence over a Levite, a Levite over a [regular] Jew, a Jew over a chalel [an illegitimate child of a priest], a chalel over a shetuki [an illegitimate child with an unknown father], a shetuki over a asufi [a foundling], an asufi over a mamzer [a child who was conceived in a union forbidden by the Torah], a mamzer over a natin [a descendent of the Gibeonites], and a natin over a stranger, so long as the natin was praised with us in holiness, and a convert takes precedence over a freed slave, for he [the slave] was once one of the cursed.161See Mishnah Horayot 3:8.
To what does this refer? When both who are imprisoned are equal in wisdom. But if there was a High Priest who was an ignoramus and a mamzer who was a wise disciple, the wise disciple takes precedence. Anyone who is great in wisdom takes precedence over another. But if one of them [the captives] was one's rabbi or father, even if there is someone who is greater in wisdom, one's rabbi or father [takes precedence]. Even if there is someone there [among the captives] who is greater in wisdom than his rabbi or his father, so long as he [his father or rabbi] is a wise disciple, he [the father or the rabbi] takes precedence over the one who is greater than them in wisdom.162See Mishnah Horayot 3:8 and Babylonian Talmud Horayot 13a.