Yevamos10: 5
אָמְרוּ לוֹ ,,מֵתָה אִשְׁתְּךָ”, וְנָשָׂא אֲחוֹתָהּ מֵאָבִיהָ; ,,מֵתָה”, וְנָשָׂא אֲחוֹתָהּ מֵאִמָּהּ; ,,מֵתָה”, וְנָשָׂא אֲחוֹתָהּ מֵאָבִיהָ; ,,מֵתָה”, וְנָשָׂא אֲחוֹתָהּ מֵאִמָּהּ, וְנִמְצְאוּ כֻלָּן קַיָּמוֹת מֻתָּר בָּרִאשׁוֹנָה, בַּשְּׁלִישִׁית, וּבַחֲמִישִׁית, וּפוֹטְרוֹת צָרוֹתֵיהֶן, וְאָסוּר בַּשְּׁנִיָּה וּבָרְבִיעִית, וְאֵין בִּיאַת אַחַת מֵהֶן פּוֹטֶרֶת צָרָתָהּ. וְאִם בָּא עַל הַשְּׁנִיָּה לְאַחַר מִיתַת הָרִאשׁוֹנָה — מֻתָּר בַּשְּׁנִיָּה וּבָרְבִיעִית, וּפוֹטְרוֹת צָרוֹתֵיהֶן, וְאָסוּר בַּשְּׁלִישִׁית וּבַחֲמִישִׁית, וְאֵין בִּיאַת אַחַת מֵהֶן פּוֹטֶרֶת צָרָתָהּ.
[If] they told him, “Your wife died,” and he married her paternal sister; [and then they told him,] “She died,” and he married her maternal sister; [and then they told him,] “She died,” and he married her paternal sister; [and then they told him,] “She died,” and he married her maternal sister; and [then] it was discovered that they are all alive —- he is permitted to the first, third, and fifth, and they release their co-wives; but he is prohibited to the second and fourth, and cohabitation with either of them does not release her co-wife. [However,] if he cohabited with the second after the first one's death —- he is permitted to the second and fourth, and they release their co-wives; but he is prohibited to the third and fifth, and cohabitation with either of them does not release her co-wife.