"These are the generations of Noah" (Genesis 6:9). Thus did Rabbi Tanchuma bar Abba open and say: "The fruit of the righteous is a tree of life, and he who is wise wins souls" (Proverbs 11:30). Rabbi Yehudah the Levite said: When a person departs from the world without children, he is distressed and weeps. The Holy One, blessed be He, says to him: Why do you weep? Because you did not raise up fruit in this world? You have fruit finer than children. He says before Him: Master of the universe, what fruit have I raised up? The Holy One, blessed be He, says to him: The Torah, of which it is written, "The fruit of the righteous is a tree of life." It does not say "children," but "the fruit of the righteous." And so the generations of a person are his good deeds. And thus it says, "These are the generations of Noah; Noah was a righteous, blameless man." Rabbi Abbahu said: We find that the Holy One, blessed be He, acts for the later ones by the merit of the earlier ones. And from where do we know that even for the earlier ones by the merit of the later ones? As it is said, "And Noah found favor in the eyes of the LORD." And by what merit? By the merit of his generations, as it is said, "These are the generations of Noah, Noah." "And he who is wise wins souls" (Proverbs 11:30): this is the one who feeds and sustains the poor. Thus did Rabbi Tanchuma expound. Our Rabbis said: Noah did not die until he saw the world settled, and until he saw seventy nations come forth from his loins; and from there only his righteousness is remembered. "And he who is wise wins souls": this is Noah, who fed and sustained the beasts. And what did he feed them? Rabbi Akiva said: They all ate pressed figs, as it is said, "And it shall be food for you and for them" (Genesis 6:21). But our Rabbis said: No, rather each and every one of every kind he fed what suited it. The camel, straw; the donkey, barley; and so all of them, each ate what suited it; hence "and he who is wise wins souls." There is a beast that eats at one hour of the day, and one at two, and one at three; and one at the third of the night, and one at its middle, and one at cockcrow. Our Rabbis said: For the twelve months that Noah was in the ark he saw no sleep, neither by day nor by night, for he was occupied with and feeding the creatures that were with him; hence "and he who is wise wins souls."
Rabbi Tanhuma the Son of Abba Began the Discussion of This Subject
Midrash Tanchuma, Noach 2
אֵלֶּה תּוֹלְדֹת נֹחַ. כָּךְ פָּתַח רַבִּי תַנְחוּמָא בַּר אַבָּא וְאָמַר, פְּרִי צַדִּיק עֵץ חַיִּים וְלֹקֵחַ נְפָשׁוֹת חָכָם (משלי יא, ל). אָמַר רַבִּי יְהוּדָה הַלֵּוִי, בְּשָׁעָה שֶׁהָאָדָם מִסְתַּלֵּק מִן הָעוֹלָם בְּלֹא בָנִים, הוּא מֵצֵר וּבוֹכֶה. אוֹמֵר לוֹ הַקָּדוֹשׁ בָּרוּךְ הוּא, לָמָּה אַתָּה בוֹכֶה? מִפְּנֵי שֶׁלֹּא הֶעֱמַדְתָּ פְרִי בָּעוֹלָם הַזֶּה, יֵשׁ לְךָ פְּרִי יָפֶה מִן הַבָּנִים. אוֹמֵר לְפָנָיו, רִבּוֹנוֹ שֶׁל עוֹלָם, אֵיזֶה פְרִי שֶׁהֶעֱמַדְתִּי. אוֹמֵר לוֹ הַקָּדוֹשׁ בָּרוּךְ הוּא, הַתּוֹרָה, שֶׁכָּתוּב בָּהּ, פְּרִי צַדִּיק עֵץ חַיִּים. בָּנִים אֵינוֹ אוֹמֵר, אֶלָּא פְּרִי צַדִּיק. וְכֵן תּוֹלְדוֹתָיו שֶׁל אָדָם, אֵלּוּ מַעֲשָׂיו הַטּוֹבִים. וְכֵן הוּא אוֹמֵר, אֵלֶּה תּוֹלְדֹת נֹחַ, נֹחַ אִישׁ צַדִּיק תָּמִים. אָמַר רַבִּי אַבָּהוּ, מָצִינוּ שֶׁהַקָּדוֹשׁ בָּרוּךְ הוּא עוֹשֶׂה לָאַחֲרוֹנִים בִּזְכוּת הָרִאשׁוֹנִים. וּמִנַּיִן שֶׁאַף לָרִאשׁוֹנִים בִּזְכוּת הָאַחֲרוֹנִים, שֶׁנֶּאֱמַר: וְנֹחַ מָצָא חֵן בְּעֵינֵי ה'. וּבְאֵיזֶה זְכוּת, בִּזְכוּת תּוֹלְדוֹתָיו, שֶׁנֶּאֱמַר: אֵלֶּה תּוֹלְדֹת נֹחַ נֹחַ. וְלוֹקֵחַ נְפָשׁוֹת חָכָם (משלי יא, ל), זֶה הַזָּן וּמְפַרְנֵס הֶעָנִי, כָּךְ דָּרַשׁ רַבִּי תַּנְחוּמָא, אָמְרוּ רַבּוֹתֵינוּ לֹא מֵת נֹחַ עַד שֶׁרָאָה הָעוֹלָם בְּיִשּׁוּבוֹ וְעַד שֶׁרָאָה ע' אֻמּוֹת יוֹצְאִים מֵחֲלָצָיו וּמִשָּׁם לֹא נִזְכָּר אֶלָּא צִדְקוֹ. וְלֹקֵחַ נְפָשׁוֹת חָכָם, זֶה נֹחַ שֶׁזָּן וּמְפַרְנֵס אֶת הַבְּהֵמָה. וּמֶה הָיָה מַאֲכִילָן? אָמַר רַבִּי עֲקִיבָא, דְּבֵלָה הָיוּ כֻלָּן אוֹכְלִין, כְּמוֹ שֶׁנֶּאֱמַר: וְהָיָה לְךָ וְלָהֶם לְאָכְלָה. וְרַבּוֹתֵינוּ אָמְרוּ, לֹא, אֶלָּא כָּל אֶחָד וְאֶחָד מִכָּל מִין וָמִין הֶאֱכִיל מַה שֶּׁלָּמֵד. הַגָּמָל, תֶּבֶן. וְהַחֲמוֹר שְׂעוֹרִים. וְכֵן כֻּלָּם מַה שֶּׁלָּמֵד הָיָה אוֹכֵל, הֱוֵי וְלֹקֵחַ נְפָשׁוֹת חָכָם. יֵשׁ בְּהֵמָה שֶׁהִיא אוֹכֶלֶת בְּשָׁעָה אַחַת בַּיּוֹם, וְיֵשׁ בִּשְׁתַּיִם וְיֵשׁ בְּשָׁלֹשׁ, וְיֵשׁ בִּשְׁלִישׁ הַלַּיְלָה וְיֵשׁ בְּאֶמְצָעוֹ, וְיֵשׁ בִּקְרוֹת הַגֶּבֶר. אָמְרוּ רַבּוֹתֵינוּ: שְׁנֵים עָשָׂר חֹדֶשׁ שֶׁהָיָה נֹחַ בַּתֵּבָה לֹא רָאָה שֵׁנָה לֹא בַיּוֹם וְלֹא בַלַּיְלָה, שֶׁהָיָה עוֹסֵק וְזָן הַבְּרִיּוֹת שֶׁעִמּוֹ, הֲרֵי וְלֹקֵחַ נְפָשׁוֹת חָכָם.