Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, said:
????? ?????? ???????? ??????????? ???? ???????? ????????????? ?????? ???????? ??????? ????????? ?????????? ????????? ???????? ???????? ??????????? ????????? ???? ????????? ??????? ???? ??????? ??????? ?????????? ??????? ???? ??????? ????????? ???? ???????? ??????????? ???? ??????? ??? ????????? ??????????? ?????????? ???? ?????? ????????
Verily, among the good deeds that will join a believer after his death are these: knowledge which he taught and spread, a righteous child he leaves behind, a copy of the Quran he leaves for inheritance, a mosque he has built, a house he built for travelers, a well he has dug, and charity distributed from his wealth while he was alive and well. These deeds will join him after his death.
Source: Sunan Ibn Ma?jah 242, Grade: Hasan