בבא קמא ו:א · Bava Kamma 6:1

הַכּוֹנֵס צֹאן לַדִּיר, וְנָעַל בְּפָנֶיהָ כָּרָאוּי, וְיָצְאָה וְהִזִּיקָה, פָּטוּר. לֹא נָעַל בְּפָנֶיהָ כָּרָאוּי, וְיָצְאָה וְהִזִּיקָה, חַיָּב. נִפְרְצָה בַלַּיְלָה אוֹ שֶׁפְּרָצוּהָ לִסְטִים, וְיָצְאָה וְהִזִּיקָה, פָּטוּר. הוֹצִיאוּהָ לִסְטִים, לִסְטִים חַיָּבִים:
In the case of one who brought his flock of sheep into the pen and locked the door before it in a manner that is appropriate, and despite this sheep went out and caused damage in another person’s field by eating produce or trampling it, the owner is exempt, since he safeguarded the animals appropriately. If he did not lock the door before the sheep in a manner that is appropriate, and sheep went out and caused damage, the owner is liable, since his negligence led to the damage. If the owner locked the door appropriately but the wall of the pen was breached at night, or bandits breached it, and sheep subsequently went out and caused damage by eating or trampling, the owner of the sheep is exempt from liability. If the bandits themselves took the sheep out of the pen and the animals subsequently caused damage, the bandits are liable.

Word-by-word Breakdown (מילים ושרשים)

הַכּוֹנֵס → one who brings [כ - נ - ס]צֹאן → a flock [צ - א - ן]לַדִּיר → into the pen [ד - י - ר]וְנָעַל → and locked [נ - ע - ל]בְּפָנֶיהָ → before it [פ - נ - ה]כָּרָאוּי → appropriately [ר - א - ה]וְיָצְאָה → and went out [י - צ - א]וְהִזִּיקָה → and caused damage [נ - ז - ק]פָּטוּר → is exempt [פ - ט - ר]לֹא → did not נָעַל → lock [נ - ע - ל]בְּפָנֶיהָ → before it [פ - נ - ה]כָּרָאוּי → appropriately [ר - א - ה]וְיָצְאָה → and went out [י - צ - א]וְהִזִּיקָה → and caused damage [נ - ז - ק]חַיָּב → is liable [ח - י - ב]נִפְרְצָה → was breached [פ - ר - צ]בַלַּיְלָה → at night [ל - י - ל]אוֹ → or שֶׁפְּרָצוּהָ → bandits breached it [פ - ר - צ]לִסְטִים → bandits [ל - ס - ט]וְיָצְאָה → and went out [י - צ - א]וְהִזִּיקָה → and caused damage [נ - ז - ק]פָּטוּר → is exempt [פ - ט - ר]הוֹצִיאוּהָ → took them out [י - צ - א]לִסְטִים → bandits [ל - ס - ט]לִסְטִים → bandits [ל - ס - ט]חַיָּבִים → are liable [ח - י - ב]