Yevamos11: 6
מִי שֶׁלֹּא שָׁהֲתָה אַחַר בַּעֲלָה שְׁלֹשָׁה חֳדָשִׁים וְנִשֵּׂאת, וְיָלְדָה, וְאֵין יָדוּעַ אִם בֶּן תִּשְׁעָה לָרִאשׁוֹן אִם בֶּן שִׁבְעָה לָאַחֲרוֹן, הָיוּ לָהּ בָּנִים מִן הָרִאשׁוֹן וּבָנִים מִן הַשֵּׁנִי, חוֹלְצִין וְלֹא מְיַבְּמִין. וְכֵן הוּא לָהֶם חוֹלֵץ וְלֹא מְיַבֵּם. הָיוּ לוֹ אַחִים מִן הָרִאשׁוֹן וְאַחִים מִן הַשֵּׁנִי שֶׁלֹּא מֵאוֹתָהּ הָאֵם, הוּא חוֹלֵץ וּמְיַבֵּם, וְהֵם, אֶחָד חוֹלֵץ וְאֶחָד מְיַבֵּם.
If a woman did not wait three months after [her divorce or widowhood from] her husband, but remarried and gave birth, and it is now known whether it was a nine-months' child by the former [husband] or a seven-months' child by the latter —- [if] she [also] had [other] sons from the first and second [husbands], these [sons] perform chalitzah but not yibum. Similarly, he performs chalitzah for them, but not yibum. [If] he had brothers by the first and second [husbands] not through his mother, he may perform either chalitzah or yibum, whereas they —- one [must] perform chalitzah [after which] the other one [may] perform yibum.