הַנִּכְנָס לִכְרַךְ מִתְפַּלֵּל שְׁתַּיִם, אַחַת בִּכְנִיסָתוֹ וְאַחַת בִּיצִיאָתוֹ. בֶּן עַזַּאי אוֹמֵר, אַרְבַּע, שְׁתַּיִם בִּכְנִיסָתוֹ וּשְׁתַּיִם בִּיצִיאָתוֹ, וְנוֹתֵן הוֹדָאָה לְשֶׁעָבַר, וְצוֹעֵק לֶעָתִיד לָבֹא:
Wer in eine Festung eintritt, bete zweimal, ein Gebet beim Eintreten und eins beim Herausgehen. Ben Asai sagt: Vier, zwei beim Eintreten und zwei beim Herausgehen. Man danke nämlich für das Vergangene und bete für das Bevorstehende.
Jerusalem Talmud Berakhot
Rebbi Eudaimon of Sepphoris170An Amora of the fifth generation, student of R. Mana. asked before Rebbi Mana: Where does one say this? He said to him: You still do not understand? Anything for the future one says in “Service”171The 16th benediction in the Galilean service, a prayer for the restitution of the Temple service. In the opinion of the Yerushalmi, that is the correct place for the insertion of the prayer for the Ninth of Ab. However, in all historical documents we have from Gaonic times and later, the insertion is made in the 14th benediction, which is a prayer for the rebuilding of Jerusalem. This is either a popular custom or a Gaonic institution. It is justified since the place is fitting and the later discussion will show that occasional variations in the prayer text are welcomed. and anything about the past one says in “Thanksgiving”172The 17th benediction, the natural place for the mention of the miracles of Ḥanukkah and Purim.. The Mishnah (Berakhot 9:6) says as much: “One gives thanks for the past and cries about the future.”
Jerusalem Talmud Berakhot
MISHNAH: He who enters a fortified place216Greek χάραξ “palisade”. A Roman fortified camp with soldiers and police not under the control of the local authorities. prays two prayers, one when he enters and one when he leaves. Ben Azai said four, two when he enters and two when he leaves. He gives thanks for the past and implores for the future.