It is narrated from Hazrat Fatimah al-Zahra that when the Prophet (peace and blessings be upon him) would enter the mosque, he would first recite blessings and peace, then he would recite this supplication: "O Allah, forgive my sins and open the doors of Your mercy for me." And when he would leave the mosque, he would also first recite blessings and peace, then he would recite this supplication: "O Allah, forgive my sins and open the doors of Your bounty for me."