Sayyiduna Abu Humayd (may Allah be pleased with him) or Sayyiduna Abu Usaid (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) said: "When any of you enters the mosque, let him say: «اَللّٰهُمَّ افْتَحْ لِيْ أَبْوَابَ رَحْمَتِكَ» (O Allah! Open for me the doors of Your mercy). And when he leaves the mosque, let him say: «اَللّٰهُمَّ إِنِّيْ أَسْأَلُكَ مِنْ فَضْلِكَ» (O Allah! I ask You for Your bounty)."