בבא מציעא ז:יא · Bava Metzia 7:11
כָּל הַמַּתְנֶה עַל מַה שֶּׁכָּתוּב בַּתּוֹרָה, תְּנָאוֹ בָטֵל. וְכָל תְּנַאי שֶׁיֵּשׁ מַעֲשֶׂה בִתְחִלָּתוֹ, תְּנָאוֹ בָטֵל. וְכָל שֶׁאֶפְשָׁר לוֹ לְקַיְּמוֹ בְסוֹפוֹ, וְהִתְנָה עָלָיו מִתְּחִלָּתוֹ, תְּנָאוֹ קַיָּם:
With regard to matters that do not involve monetary claims, anyone who stipulates counter to that which is written in the Torah, his stipulation is void. And any condition that is preceded by an action, i.e., the agreement is formulated with the promise of an action followed by a statement that this action will be carried out only under certain terms, the condition is void and the promise remains intact. The condition must be stated before the action. And with regard to any condition that one can ultimately fulfill, but he stipulated with him initially, i.e., in practice the action is performed first, followed by the fulfillment of the condition, nevertheless, because it was formulated in the proper manner, with the condition first, his condition is valid. If the condition cannot be fulfilled at all, once the action has been carried out the condition is void.
Word-by-word Breakdown (מילים ושרשים)
כָּל → Anyone who [כ - ל - ל]הַמַּתְנֶה → stipulates [ת - נ - ה]עַל → counter to [ע - ל]מַה → that [מ - ה]שֶּׁכָּתוּב → which is written [כ - ת - ב]בַּתּוֹרָה → in the Torah, [י - ר - ה]תְּנָאוֹ → his stipulation [ת - נ - ה]בָטֵל → is void. [ב - ט - ל]וְכָל → And any [כ - ל - ל]תְּנַאי → condition [ת - נ - ה]שֶׁיֵּשׁ → that has [י - שׁ - ה]מַעֲשֶׂה → an action [ע - שׂ - ה]בִתְחִלָּתוֹ → at its beginning, [ת - ח - ל]תְּנָאוֹ → his condition [ת - נ - ה]בָטֵל → is void. [ב - ט - ל]וְכָל → And anyone [כ - ל - ל]שֶׁאֶפְשָׁר → that is possible [פ - שׁ - ר]לוֹ → for him לְקַיְּמוֹ → to fulfill it [ק - י - ם]בְסוֹפוֹ → at its end, [ס - ו - ף]וְהִתְנָה → and he stipulated [ת - נ - ה]עָלָיו → regarding it [ע - ל]מִתְּחִלָּתוֹ → initially, [ת - ח - ל]תְּנָאוֹ → his condition [ת - נ - ה]קַיָּם → is valid. [ק - י - ם]